How to Convert an Array to a String in Power Automate [3 Different ways]

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.

See also  How to Select First Item in a Power Apps Gallery

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')
convert array to string power automate

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')
How to convert array to string power automate

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.

how to convert an array to a string in power automate flow

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')
how to convert an array to a string using power automate

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'),',')
How to convert array to string power automate flow

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.

how to convert an array to a string in power automate

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.

See also  How to Delete all rows from a SharePoint Online list using Power Automate

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
convert array to string power automate flow

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
Power Automate convert array to string

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)

convert an array to a string power automate

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')
how to convert an array to a string power automate

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.

how to convert an array to a string using power automate flow

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:

>