Do you need to convert an array to a string in Power Automate? Then, this Power Automate tutorial is for you. Here, I will show you how to convert an array to a string in Power Automate.
Convert an Array to a String in Power Automate
While working on Product development, I need to convert an array of values to strings using Power Automate flow. For example, My array values look like the below:
[
"PowerApps",
"PowerAutomate",
"PowerBI"
]
Once I converted to the string values from an array values, The expected output looks like the below:
PowerApps,PowerAutomate,PowerBI
Here, I will show you three examples of converting array values to string values using flow.
In the first example, I will show you an easy way to convert an array to a string value using the Join action.
In the second example, I will show you how to convert an array to a string value using the flow’s join() function.
Finally, I will show you how to convert an array of objects to a string value using the select data operation in the flow.
Now, let’s start to create a flow for converting an array to a string in Power Automate.
Convert an Array to a String in Power Automate using Join Action
In this example, I will show you an easy way to convert an array to a string value by using the Join action in Power Automate.
1. Create an instant cloud flow with a manual trigger, initialize a variable with a variable type as an array, and in the values section, pass the below values:
createArray('PowerApps','PowerAutomate','PowerBI')
2. Add a new step and choose the join action; in the from section, pass the initialized variable and join with a comma separator as shown below:
variables('VarArray')
3. Save and Run the flow. Once the flow runs successfully, Expand the Join action, and in the Output section, we can see that the array values have been converted to String values.
This is how to convert an array to a string using the join action in Power Automate.
Convert an Array to a String in Power Automate using Join() Function
In this example, I will show you how to convert an array to a string value using Power Automate’s join() function.
1. Create an instant cloud flow with a manual trigger, initialize a variable with a variable type as an array, and in the values section, pass the below values:
createArray('Database','My SQL','Oracle Database')
2. Add a new step and choose the compose data operation, pass the below value to convert the values from an array to a string.
join(variables('VarArray'),',')
3. Save and Run the flow. Once the flow runs successfully, Expand the Join function, and in the Output section, we can see that the array values have been converted to String values.
This is how to convert an array to a string using the join function in Power Automate flow.
Convert an Array to a String in Power Automate using Select Action
In this example, how to convert an array of objects to a string value by using the select() action from the SharePoint list.
Here, I am going to use the below Technology SharePoint list consisting of the below columns:
- Technology – default title column
- Description – Multi line of text
1. Create an instant cloud flow with a manual trigger, add a new step, choose the get items action, and configure the required parameters.
- Site Address – Select the SharePoint site address from dropdown
- List Name – choose the list name from the dropdown
2. Add a new step and choose the select data operation; in the from section, choose the value from the dropdown.
In the Map section, switch the map to text and pass the below expression:
item()?['Title']
Title – Technology field (Column internal name)
3. Add a new step and choose the join action, in the from section, select the output of the previous data operation and join the comma separator as shown below:
body('Select')
4. Save and Run the flow. Once the flow runs successfully, Expand the Join function in the Output section. We can see that the array of object values has been converted to String values for the SharePoint list Technology field.
This is how to convert an array of objects to a string value by using the select() action from the SharePoint list.
Conclusion
I hope you understand how to convert an array to string values using Power Automate flow. I have shown you three ways to convert an array to a string value using the Join action, join() function, and select data operation in Power Automate.
You may also like:
- How to Get Unique Values from an Array in Power Automate?
- How to check if an array contains value using Power Automate?
- How to create an array from JSON objects using Power Automate?
- How to merge arrays in Power Automate?
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.