{"id":82,"date":"2024-09-06T12:09:22","date_gmt":"2024-09-06T19:09:22","guid":{"rendered":"https:\/\/gilosoftblogcom.wordpress.com\/?p=82"},"modified":"2024-09-06T12:09:22","modified_gmt":"2024-09-06T19:09:22","slug":"82","status":"publish","type":"post","link":"https:\/\/blog.gilosoft.com\/index.php\/2024\/09\/06\/82\/","title":{"rendered":"Using EndsWith function in Power Automate"},"content":{"rendered":"\n<p>A notable feature of Power Automate is its capability to manipulate strings through different expressions, such as the&nbsp;<code>concat<\/code>&nbsp;function.<\/p>\n\n\n\n<p>A powerful feature of Power Automate is the power to change strings using different expressions, such as the endsWith function. In this blog post, we will explore how to utilize the endsWith function in Power Automate to enhance and streamline your workflows.<\/p>\n\n\n\n<p><strong>What is the EndsWith Function?<\/strong><\/p>\n\n\n\n<p>The&nbsp;<code>endsWith<\/code>&nbsp;function in Power Automate is used to check if a string ends with a specified substring. This function returns a Boolean value (<code>true<\/code>&nbsp;or&nbsp;<code>false<\/code>), making it particularly useful for conditional logic in your flows. For instance, you might want to check if a filename ends with a particular extension or if a text message ends with a specific word or character.<\/p>\n\n\n\n<p><strong>Syntax of the EndsWith Function<\/strong><\/p>\n\n\n\n<p>The basic syntax of the &#8216;endsWith&#8217; function is:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nendsWith(string, substring)\n<\/pre><\/div>\n\n\n<p>The &#8216;string&#8217; is the main string you want to check, and the &#8216;substring&#8217; is the substring you want to verify if if appears at the end of the main string.<\/p>\n\n\n\n<p><strong>Step-by-Step Guide to Using the EndsWith Function<\/strong><\/p>\n\n\n\n<p><strong>Step 1:<\/strong> Create A New Flow<\/p>\n\n\n\n<p>Go to Power Automate (<a href=\"https:\/\/make.powerautomate.com\/\">flow.microsoft.com<\/a>) and create a instant cloud flow with a manual trigger. After you have created a title select &#8220;Create&#8221; to begin building the flow.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"514\" src=\"https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.21.35e280afpm.png?w=817\" alt=\"\" class=\"wp-image-86\" srcset=\"https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.21.35e280afpm.png 817w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.21.35e280afpm-300x189.png 300w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.21.35e280afpm-768x483.png 768w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><\/figure>\n\n\n\n<p><strong>Step 2:<\/strong> Add &#8220;Initialize variables&#8221; action card following the below image as a template:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1094\" height=\"474\" src=\"https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.59.08e280afpm.png?w=1024\" alt=\"\" class=\"wp-image-88\" srcset=\"https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.59.08e280afpm.png 1094w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.59.08e280afpm-300x130.png 300w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.59.08e280afpm-1024x444.png 1024w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.59.08e280afpm-768x333.png 768w\" sizes=\"auto, (max-width: 1094px) 100vw, 1094px\" \/><\/figure>\n\n\n\n<p><strong>Step 3: <\/strong>Add a &#8220;Compose&#8221; action card and fill the &#8220;inputs&#8221; section with the below expression:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nendsWith(variables('textInput'), 'Smith')\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1094\" height=\"770\" src=\"https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.54.47e280afpm-1.png?w=1024\" alt=\"\" class=\"wp-image-89\" srcset=\"https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.54.47e280afpm-1.png 1094w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.54.47e280afpm-1-300x211.png 300w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.54.47e280afpm-1-1024x721.png 1024w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.54.47e280afpm-1-768x541.png 768w\" sizes=\"auto, (max-width: 1094px) 100vw, 1094px\" \/><\/figure>\n\n\n\n<p><strong>Step 4:<\/strong> Save and test the flow. The results will be as shown in the below image:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1094\" height=\"694\" src=\"https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.56.13e280afpm.png?w=1024\" alt=\"\" class=\"wp-image-90\" srcset=\"https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.56.13e280afpm.png 1094w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.56.13e280afpm-300x190.png 300w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.56.13e280afpm-1024x650.png 1024w, https:\/\/blog.gilosoft.com\/wp-content\/uploads\/2024\/09\/screenshot-2024-07-16-at-12.56.13e280afpm-768x487.png 768w\" sizes=\"auto, (max-width: 1094px) 100vw, 1094px\" \/><\/figure>\n\n\n\n<p><strong>Conclusion<\/strong><\/p>\n\n\n\n<p>The&nbsp;<code>endsWith<\/code>&nbsp;function in Power Automate is a powerful tool for checking if a string ends with a specified substring. This functionality is crucial for various automation scenarios, such as file validation, message parsing, and URL verification. By incorporating the&nbsp;<code>endsWith<\/code>&nbsp;function into your flows, you can create more dynamic and conditional workflows, enhancing your automation capabilities.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A notable feature of Power Automate is its capability to manipulate strings through different expressions, such as the&nbsp;concat&nbsp;function. A powerful feature of Power Automate is the power to change strings using different expressions, such as the endsWith function. In this blog post, we will explore how to utilize the endsWith function in Power Automate to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":92,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-82","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\/82","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=82"}],"version-history":[{"count":0,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/media\/92"}],"wp:attachment":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}