This Microsoft Power Automate tutorial will learn how to convert a string to various data types on Power Automate or Microsoft flow. And these topics are:
- Power Automate convert string to integer
- Power Automate convert string to currency
- Power Automate convert string to Date
- Power Automate convert array to string
- Power Automate convert string to Guid
- Power Automate convert string to JSON Object
- Power Automate convert string to Array
- Power Automate convert string to float
Power Automate convert string to integer
Here we will see how to convert a string to an integer and also we will calculate the sum of these integers on Power Automate. For this, we have to follow this step-by-step guide.
Step-1:
On Power Automate, we will start by triggering the flow manually by adding “Manually trigger a flow” from Instant cloud flow. Also, we will add two user inputs as Text like below:

Step-2:
In the next step, we will add a Compose action that will convert the text or string input to an integer. For this, we will use an expression using int().
int(triggerBody()['text'])
(Here we took the text i.e. text1 from dynamic content)

Step-3:
Similarly, we will add again a Compose action, that will convert the input( on text2 ) to an integer using the int() expression.
int(triggerBody()['text_1'])
(Here we are using the input from text2)

Step-4:
Now our flow is ready. When we will run, it will ask to insert two inputs as text1 and text 2. After successfully run we can see it converts the string(inputs) into an integer.


Step-5:
Now we want to add these integers on Power Automate. For this, we will add again a Compose action and insert the below expression.
add(outputs('Compose'),outputs('Compose_2'))

Similarly, when we enter two string values it will convert these into integers and calculate their addition. Here we are going to take the same values i.e. 50 & 35.

This is how to do Power Automate convert string into an integer. You can download this flow from here.
Also read, Power Automate Number Format
Power Automate convert string to currency
Now, we will discuss how to convert a string into currency in an automated flow or Microsoft flow. To solve this, here we have provided a step-by-step guide. Please have a look at these below steps.
Step-1:
First, we will trigger our flow manually. For this, on Power Automate, click on “Create” then select “Instant cloud flow” and click on “Manually trigger flow“.

After clicking on Create, we can see our flow is triggered manually.
Step-2:
Now we will add the action “Initialize variable” to initialize a variable and set the type as “String” on the flow. Also, insert a value that you want to convert into a currency data type.

Step-3:
Then we will add a Compose action that will convert the string value into an integer. Insert the below formula in the expression bar as inputs.
int(variables('VarString'))

Step-4:
Then again we will add another action “Format number” to format the output of the compose into currency.

Now our flow is ready. To test it, first, we have to Save and click on the Manually. Here is the result.

This is how we can convert a string to a currency in Microsoft flow.
You can download this flow from here. We hope it might help you.
Read Power Automate Initialize Variable
Power Automate Convert String to Date
Now, we will discuss how to convert a string into a Date in Power Automate or Microsoft Flow.
This is one of the day-to-day requirements of conversion from string to date. For example, we have a date input string such as 22,10,2021. We can see in that date the day, month and year are separated with a comma. But we want to convert this string input in a date format i.e. 22 October 2021.
Step-1:
In Power Automate, we will start from trigger the flow manually. We can add this from Instant cloud flow.
Step-2:
Then we will add an action as Initialize variable. Here we will set a date as string input like below:

Step-3:
Again, we will add the same action as Initialize variable that will convert the date string into an array and split the day-month-year with a comma by using the Split() expression. As the date string(22,10,2021) is not understood by Power Automate so we need to add this step.
split(variables('VarDateInString'), ',')

Step-4:
In this step, we will convert this array to our desired date format. For this, we will add the same action as “initialize the variable“. In this action, we will insert an expression that will format the array in Date. The expression is:
formatDateTime(concat(variables('VarDate')[2], '-', variables('VarDate')[1], '-', variables('VarDate')[0]), 'dd MMMM yyyy')

Here we set the date format as “dd MMMM YYYY” so it will return with the full month name i.e. 22 October 2021. Let’s check this output by saving and testing the flow.

Similarly, if we insert the date format as ” dd MMM YYYY ” then the month will return with a sort name such as 22 Oct 2021.

This is how we can convert a string into a Date in Power Automate. You can download this final flow from here.
Also read, Power Automate convert time zone
Power Automate convert array to string
Here, we will see how to convert an array to a string in Power Automate or Microsoft flow.
For example, we have some cities’s names in an array format. Such as:
[ "New York","Chicago", "Texas", "California"]
But, we want this array in a string format on Power Automate. So for this, Let’s have a look at the below steps.
Step-1:
In Power Automate, first, we will add “Manually trigger a flow” from “instant cloud flow“.
Step-2:
After adding this, we will add the action “Join” under the “Compose” action.

This Join has 2 parameters. One is From where we insert an array, and another one is Join with where we need to convert it to a string separated by a comma.

Now just Save the flow and Run it. In the output, we can see the array is converted into a string like below:

This is how we can convert an array into a string in Power Automate. You can download this flow from here.
Also read, Power Automate Concatenate String
Power Automate convert string to Guid
Guid stands for Globally Unique Identifier. Now we will see how to convert a string into Guid format on Power Automate.
First, we need to trigger the flow manually to implement this. Then we will initialize a variable by using a string guid. For example, we have a guid string “f0e4273f10c14551a494977ebeb5b5fa“.

Again we will add the “Initialize variable” action. On the value section, we will add an expression that will convert the string into guide format without braces. The expression is:
concat(substring(variables('VarGuid'),0,8),'-',substring(variables('VarGuid'),8,4),'-',substring(variables('VarGuid'),12,4),'-',substring(variables('VarGuid'),16,4),'-',substring(variables('VarGuid'),20,12),'')

Similarly, we will add another “Initialize variable“, where we will insert an expression that will convert the string into guid format with curly braces. For this, the expression is:
concat('{',concat(substring(variables('VarGuid'),0,8),'-',substring(variables('VarGuid'),8,4),'-',substring(variables('VarGuid'),12,4),'-',substring(variables('VarGuid'),16,4),'-',substring(variables('VarGuid'),20,12),''),'}')

Now the flow is ready. We can see the result by saving and testing it.

This is how we can convert a string to GUID format on Power Automate.
There is another way to create GUID dynamically on Power Automate. For this, Microsoft Flow provides a function “guid()“. It used to return a new GUID in a string format but it does not create a GUID based on the string format that we provided.
Now we will see how to create a GUID using guid() on Power Automate. For this, here we will take a Compose action

Let’s run the flow to check the New Guid on the output.

This is how we can create a Guid using guid() on Power Automate. You can download this total flow from here.
Also read, Leave Request Approval Flow using Power Automate or Microsoft Flow
Power Automate convert string to Array
In this section, we will see how to convert a simple string into an array in Power Automate. There is a function that will convert the input into an array.
For example, we have a string i.e. California, Florida, Texas, Arizona, Washington, New York.
Now we will use this string as a variable by initializing on Power Automate:

To convert this to an array, we will use an expression on Compose action.
array(variables('VarArray'))

Now just save the flow and test it. We can see the output coming as an Array format like below:

This is how to convert string to Array Format on Power Automate.
Also read, How to convert decimal to whole number in Power Automate + convert decimal to percentage
Power Automate Convert String to Float
Here we will see how to convert a string(having decimal places) value to float on Power Automate. In Power Automate, there is a float function that will convert the input to float.
Let’s initialize a variable having a string value of 45.69:

Then we will use the float() function on a Compose action to convert the input variable to float.
float(variables('VarString'))

On the output, we see the string value is converted to float:

This is how to convert a string value to float on Microsoft flow.
Read How to move files from OneDrive to SharePoint using Power Automate
Power Automate convert string to json
Here we will see how to convert a string input into JSON format on Power Automate. For example, let’s take a string such as:
{"City":"Texas", "Name":"Alice","Number": "+1(408)7859963"}

Then we will use a Compose a to convert the string to JSON object in Power Automate. For this here we will use an expression:
json(variables('VarString'))

Now we can save the flow and test it and we can see the out put is coming as JSON object format:

This is how to convert string to JSON Object on Power Automate.
You may like the following Power Automate tutorials:
- Run Flow on a Schedule in Power Automate
- Power Automate Delete all items in SharePoint list
- PowerApps upload file to SharePoint document library
- Save my email attachments to a SharePoint document library Power Automate or Flow
- Send a customized email when a new SharePoint list item is added using Microsoft Power Automate or Flow
- Microsoft Flow Example: Copy Files from SharePoint to PC
Conclusion
From this above tutorial, we learned all about string conversion on Power Automate. Also, we discussed:
- How to convert a string to an integer on Power Automate?
- How to convert a string to a date format on Power Automate?
- How to convert a string to a currency format on Microsoft flow?
- How to convert the array into a string on Power Automate?
- How to convert a string into GUID format on Microsoft Flow?
- How to convert a string into an Array on Power Automate?
- How to convert a string value into float on Power Automate?
- How to convert a string to JSON object on Power Automate?
I am Bijay a Microsoft MVP (8 times –Â My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com