Do you want to convert the number value to a string using Power Automate? In this Power Automate Tutorial, we will discuss how to convert a value to a string in Power Automate.
Here, we are going to cover the topics below:
- How to convert the value to a string using the String() function in Power Automate
- How to convert the value to a string using the Format Number action in Power Automate
- How to convert the value to a string using formatNumber() function in Power Automate
Convert a value to a string using String() function in Power Automate
In this method, we will see how to convert a number to a string using the string() function in Power Automate.
1. In Power Automate flow, we will add a “Manually trigger a flow” action from “instant cloud flow“. We will add a compose action after adding this trigger to our flow. In that action, we will use any static value as an input. For example, here we will use a random number, i.e., 123
2. Again, we will add another Compose action that will format the output of the compose(i.e. 54321) into a string by using an expression. Insert the below expression in the expression bar and click on Update.
string(outputs('Compose'))
3. Now, the flow is ready. So we need to just Save and test it. We can see the output is coming as “string“.
This is how to convert a number to a string using Power Automate Flow’s string() function.
Convert value to a string using Format Number action in Power Automate
Here, we will see how to convert the value to a string using the Format Number action in Power Automate.
For example, we have an integer 54321, and we will convert it into string ‘54321’ for this, we need to pass the string format, i.e., 0000, in the format action.
1. In Power Automate Cloud, create an Instant cloud flow and select Manually trigger a flow action.
2. Next, click on the +New step -> select Format number action. Then provide the information below
- Number: Provide the number you want to format
- Format: Provide the format as 0000
Save and run the flow manually; the number is converted to a string.
This is how to format numbers to strings using the Format Number action in Power Automate.
Convert the value to a string using formatNumber() function in Power Automate
Here, we will see how to convert the value to a string using the formatNumber() action in Power Automate.
For example, we have an integer 54321, and we will convert it into string ‘54321’ for this, we need to pass the string format, i.e., 0000, in the formatNumber().
1. In Power Automate Cloud, create an Instant cloud flow and select Manually trigger a flow action.
2. Next, click on the +New step -> select Compose action. Then provide the below information:
- Inputs: Provide the expression as ‘formatNumber(54321,’0000′)’
3. Now run the flow manually, and you can see the given integer is converted to string in Power Automate.
This is how to convert the value to a string using formatNumber() in Power Automate.
Conclusion
In this Powe Automate tutorial, we saw how to convert the value to a string in Power Automate using the three ways below:
- string() function
- Format number flow action
- formatNumber() function
You may also like:
- Convert String to Date for SharePoint list using Power Automate
- Convert True to Yes in Power Automate
- Convert Float to Integer in Power Automate
- Convert an Integer to an Array in Power Automate
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 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