{"id":25106,"date":"2020-10-16T12:57:05","date_gmt":"2020-10-16T12:57:05","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=25106"},"modified":"2020-10-16T12:57:05","modified_gmt":"2020-10-16T12:57:05","slug":"text-functions-action-in-power-automate-within-dynamics-365","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/10\/text-functions-action-in-power-automate-within-dynamics-365\/","title":{"rendered":"Text Functions Action in Power Automate within Dynamics 365"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p style=\"text-align: justify;\">Whenever we want to extract part of a string, a common question comes to mind -how do we achieve this? In Power Automate, previously we used to write some expression manually like split, substring and so on. But now, in the recent update of Power Automate, it now gives you prebuilt actions for text\/string operations as shown in the below image.<\/p>\n<p>At the time of writing this blog, there are only two actions available.<a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/1-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25117 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/1-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png\" alt=\"\" width=\"765\" height=\"499\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/1-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png 765w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/1-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-300x196.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/1-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-660x431.png 660w\" sizes=\"(max-width: 765px) 100vw, 765px\" \/><\/a><\/p>\n<h2><strong>Find Text Position<\/strong><\/h2>\n<p style=\"text-align: justify;\">As the name suggests, it helps in finding out the position of a text in a string.<\/p>\n<p>Previously, if we wanted to find the particular text value from a string we had to write down the expression such as \u201c<strong>indexOf(triggerBody()?[&#8216;notes&#8217;], &#8216;title&#8217;)<\/strong>\u201d in Power Automate to get the result.<\/p>\n<p>But now with the help of Find Text Position action, the task of finding a text has been simplified.<\/p>\n<p>The Find Text Position action will return the Text Position if the search text is present in the given string as shown in the below image.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/3-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25119 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/3-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png\" alt=\"Text Functions Action in Power Automate within Dynamic 365 CRM\" width=\"628\" height=\"736\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/3-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png 628w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/3-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-256x300.png 256w\" sizes=\"(max-width: 628px) 100vw, 628px\" \/><\/a><\/p>\n<p>Otherwise, it will return the Text Position as -1.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/4-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25118 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/4-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png\" alt=\"Text Functions Action in Power Automate within Dynamic 365 CRM\" width=\"586\" height=\"708\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/4-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png 586w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/4-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-248x300.png 248w\" sizes=\"(max-width: 586px) 100vw, 586px\" \/><\/a><\/p>\n<p>Similarly, we can use the <strong>Substring<\/strong> action to get the required string value from the text as explained below.<\/p>\n<h2><strong>Substring<\/strong><\/h2>\n<p style=\"text-align: justify;\">In this action, you can configure the starting index and length of the string and it will return the substring.<\/p>\n<p>Previously, if we wanted to get the substring we had to write the expression like <strong>substring(triggerBody()?[topic],0,5)<\/strong> in which 0 is the starting position from where we want to start the substring function and 5 is the length of the string we want to extract from the starting position.<\/p>\n<p>Now Substring Action eases this process.<\/p>\n<p>In our below example screenshot, we want to extract the string value from the 0<sup>th<\/sup> to 5<sup>th<\/sup> index so we enter the start position as 0 and length as 5 since we want to extract the string till the 5<sup>th<\/sup> index of the string. We simply enter these values and based on them it will return the substring value.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/2-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25120 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/2-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png\" alt=\"Text Functions Action in Power Automate within Dynamic 365 CRM\" width=\"592\" height=\"596\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/2-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM.png 592w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/2-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-150x150.png 150w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/2-Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-298x300.png 298w\" sizes=\"(max-width: 592px) 100vw, 592px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Similarly, if Substring is out of the range, which means exceeding the length of the entire string, you will get an error as shown in the below image.<\/p>\n<p>In our below example the entered string length was less than 5 characters, so the Substring action failed to extract it and gives the error as shown in the below image.<\/p>\n<p><strong> <a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-5.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-25108 size-full\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-5.png\" alt=\"Text Functions Action in Power Automate within Dynamic 365 CRM \" width=\"595\" height=\"271\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-5.png 595w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/10\/Text-Functions-Action-in-Power-Automate-within-Dynamic-365-CRM-5-300x137.png 300w\" sizes=\"(max-width: 595px) 100vw, 595px\" \/><\/a><\/strong><\/p>\n<h2><strong>Conclusion<br \/>\n<\/strong><\/h2>\n<p style=\"text-align: justify;\">Now, with the addition of these actions, the idea of Low Code No Code has been taken a step further and we can expect more prebuilt actions in the coming future.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Whenever we want to extract part of a string, a common question comes to mind -how do we achieve this? In Power Automate, previously we used to write some expression manually like split, substring and so on. But now, in the recent update of Power Automate, it now gives you prebuilt actions for text\/string\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/10\/text-functions-action-in-power-automate-within-dynamics-365\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,18,19,1985],"tags":[545,2007,592,1975],"class_list":["post-25106","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-power-automate","tag-dynamics-365-crm","tag-dynamics-365-power-automate","tag-dynamics-crm","tag-power-automate"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/25106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=25106"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/25106\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=25106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=25106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=25106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}