{"id":73,"date":"2024-09-06T11:33:27","date_gmt":"2024-09-06T18:33:27","guid":{"rendered":"https:\/\/gilosoftblogcom.wordpress.com\/?p=73"},"modified":"2024-09-06T11:33:27","modified_gmt":"2024-09-06T18:33:27","slug":"using-trim-function-in-power-automate","status":"publish","type":"post","link":"https:\/\/blog.gilosoft.com\/index.php\/2024\/09\/06\/using-trim-function-in-power-automate\/","title":{"rendered":"Using Trim Function in Power Automate"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>What is the Trim Function?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<code>trim<\/code>&nbsp;function in Power Automate is used to remove leading and trailing whitespace characters from a string. This is especially useful when dealing with data input from users, importing data from external sources, or ensuring that text data conforms to a specific format.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this blog you will learn how to trim a variable in Power Automate. You will learn how to change &#8216; Hello, World!&#8217; to &#8216;Hello, World!&#8217;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1:<\/strong>&nbsp;Create a new instant cloud flow with a manual trigger. Use this link&nbsp;<a href=\"https:\/\/make.powerautomate.com\/\">&#8220;make.powerautomate.com&#8221;<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gilosoft.com\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-19-at-2.08.16%E2%80%AFPM-1024x650.png\" alt=\"\" class=\"wp-image-2347\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2: <\/strong>Add &#8216;Initialize variable&#8217; action card with the following details:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gilosoft.com\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-19-at-2.31.59%E2%80%AFPM-1024x309.png\" alt=\"\" class=\"wp-image-2349\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3:<\/strong> Add a compose action card and fill the input field with the following expression:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntrim(variables('Text'))\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gilosoft.com\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-19-at-2.15.44%E2%80%AFPM-1024x371.png\" alt=\"\" class=\"wp-image-2350\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 4:<\/strong> Save and Test Flow. The results of the flow should be as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gilosoft.com\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-19-at-2.28.17%E2%80%AFPM-858x1024.png\" alt=\"\" class=\"wp-image-2351\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>What is the Trim Function? The&nbsp;trim&nbsp;function in Power Automate is used to remove leading and trailing whitespace characters from a string. This is especially useful when dealing with data input from users, importing data from external sources, or ensuring that text data conforms to a specific format. In this blog you will learn how to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":76,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-power-automate-text-functions"],"_links":{"self":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":0,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/media\/76"}],"wp:attachment":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}