In this blog post we will learn how to split string in power automate to an array and how to access array elements in power automate.
How to split string in power automate?
In Power Automate , you can split a string into an array using the split() function.
Example: Suppose we have a flow that receive an input string with the following format text||text||text we need to split the string using the || delimiter and put it in an array
Use split function :In PowerApps, the Split
function is used to break a text string into a table of substrings based on a specified delimiter.
Delimiter
: The character or characters that define the boundaries between the substrings
Syntax:
Split(Text, Delimiter)
So in our case the delimiter is || so the code of the split function will be as shown below.
split(triggerBody()['text'],'||')
The Out put will be an array of substrings, and you can use it in subsequent steps of your flow.
how to access array elements in power automate?
You can access array elements within various actions like “Compose,” “Apply to each,” or directly in dynamic content.
For example the Output of the previous compose action we can access the elements of the array using it’s index that begin with 0 for the first element, 1 for the second element and so on.
For example to retrieve the second element of the array access it with Youraction[1]
The number inside the square brackets indicates the index of the element you want to access.
The Output will be Heba the second element in the array
This is how to split string in power automate into array and access the array elements by index.
See Also
- New Power Automate Designer Features
- OData Filter Query Power Automate In SharePoint Get Items |
- How Power Automate Create Excel Table Dynamically? | Power Automate
- How To Make A Csv File Utf-8 Encoded? | Power Automate
- How Power Automate Create Excel Table Dynamically?
- How To Format Text In PowerApps? PowerApps Convert Text To Other Data Types
- Alternate Row Color In Gallery PowerApps: Simplest Way
- Check If PowerApps Contains Substring
- PowerApps Get Day Of Week Date
Join us
- Subscribe to Power Platform Geeks YouTube channel.
- Register to Saudi Arabia Power Platform User Group.
Excellent blog here Also your website loads up very fast What web host are you using Can I get your affiliate link to your host I wish my web site loaded up as quickly as yours lol
aesthetically pleasing portion of the content I recently came into and I must admit that I truly enjoyed reading your blog entries. Nevertheless, I will be signing up for your updates and even I hope to receive them quickly every time.
Your commitment to quality really stands out. ❤️