Do you want to convert an integer to an array in Power Automate? In this Power Automate tutorial, we will see how to convert an integer to an array using Power Automate.
In this tutorial, we will cover the below topics:
- How to convert an integer to an array using an array() in Power Automate
- How to convert an integer to an array using [] in Power Automate.
- How to convert integer string to Array using split() in Power Automate
- How to convert an integer to an array using createArray() in Power Automate
- How to convert an integer from a SharePoint list to an array in Power Automate
Convert integer to Array using array() in Power Automate
Here, we will see how to convert an integer to an Array using array() in Power Automate.
For example, we have an integer 234 and will convert it to an array [234] using Array(). For this, the expression is array(234), returns [234].
Step 1: Open Power Automate Cloud, click on +Create and select Instant Cloud flow.
Then, provide the flow name and select Manually trigger a flow. Then click on Create.
You can see that a “Manually trigger a flow” action is added to the flow page.
Step 2: Next, initialize an integer variable num 1, and assign the value. For this, click on the +New step -> select Initialize variable action. Then provide the below information:
- Name: Provide the variable name
- Type: Provide the type as an integer
- Value: Provide the value
Step 3: We will convert this integer into an array using Power Automate; for this, click on Add an action-> select Compose action. Then provide the below information:
- Inputs: Provide the below expression:
array(variables('num1'))
Step 4: Now run the flow manually, and you can see the integer is converted to an array.
This is how to convert an integer to an array using array () in Power Automate.
Convert an integer to an array using [] in Power Automate
Here, we will see how to convert an integer to an array using [] in Power Automate.
For example, we have two integers 234, and 245, and we will convert them to an array [234, 245]. To do this in Power Automate, we have to define two integer variables, num 1 and num2, and assign the integer to them.
Then, in the compose action as an input, we will pass these two variables in [] like this [num1, num 2]. The result will be [234, 245].
Step 1: Open Power Automate Cloud, click +Create, and select Instant Cloud flow.
Then, provide the flow name, and select “Manually trigger a flow” action. Then click on Create.
Now, you can see the “Manually trigger a flow” action is added to the flow page.
Step 2: Next, initialize two integer variables, num 1 and num2, and assign the value like below. For this, click on the +New step -> select Initialize variable action. Then provide the below information:
Name | Type | Value |
---|---|---|
num 1 | Integer | 23 |
num 2 | Integer | 24 |
Step 3: We will convert these integers into an array using Power Automate; for this, click on Add an action -> select Compose action. Then provide the below information:
- Inputs: Provide the below value
[num 1, num2]
Step 4: Now run the flow manually, and you can see the integer is converted to an array.
This is how to convert an integer to an array using [] in Power Automate.
Convert an integer to an array using createArray() in Power Automate
Here, we will see how to convert an integer to an array using createArray() in Power Automate.
For example, we have two integers 23, 26, 27, 28, and we will convert them to an array [23, 26, 27, 28]. To do this in Power Automate, createArray() in Power Automate. So, the expression will be
createArray(23, 26, 27, 28) it returns [23,26,27, 28]
Step 1: Open Power Automate Cloud, click on +Create and select Instant Cloud flow.
Then, provide the flow name and select Manually trigger a flow. Then click on Create.
Now you can see “Manually trigger a flow” is added to the flow page.
Step 2: We will convert the integer to an array using Power Automate; for this, click on the +new step -> select Compose action. Then provide the below information:
- Inputs: Provide the below expression:
createArray(23, 24,25,26)
Step 3: Now run the flow manually and you can see the integer is converted to an array.
This is how we can convert integer to an array using createArray() in Power Automate.
Convert string integer to Array using split() in Power Automate
Here, we will see how to convert a string integer to an Array using split () in Power Automate.
For example, we have an integer in string format such as 20, 40,50, and we need to convert it to an array i.e. [20, 40, 50] in Power Automate.
Step 1: Open Power Automate Cloud, click on +Create and select Instant Cloud flow.
Then, provide the flow name and select Manually trigger a flow. Then click on Create.
You can see that a “Manually trigger a flow” action is added to the flow page.
Step 2: Next, we will initialize a string variable, assigning a number of string types like below. For this, click on the +New step -> select Initialize variable action and then provide the below information:
- Name: Provide the variable name
- Type: Select string from dropdown
- Value: Provide the value like below
Step 3: Now we will convert the string type integer to an array; for this, click on +New step -> select Compose action. Then provide the below information:
- Inputs: Provide the below expression
split(variables('numbers'),',')
Step 4: Now run the flow manually, and you can see the integer is converted to an array.
This is how to convert the string integer to an array using split() in Power Automate.
Convert an integer from a SharePoint list to an array in Power Automate
Here, we will see how to convert an integer from a SharePoint list to an array in Power Automate.
For example, we have a product list in SharePoint containing two columns: Product and Price. So, we will get the price from the list and convert it into an array.
To do this in Power Automate, follow the below steps
Step 1: Open Power Automate Cloud, click on +Create and select Instant Cloud flow.
Then, provide the flow name, and select Manually trigger a flow. Then click on Create.
Now, you can see the “Manually trigger a flow” action is added to the flow page.
Step 2: Now we will get items from the list in SharePoint; for this, click on +New step -> select Get items action. Then provide the below information:
- Site address: Provide the SharePoint site address
- List name: Provide the SharePoint list name
Step 3: Next, initialize the array variable; click on the +New step -> select Initialize variable action. Then provide the below information:
- Name: Provide the name as Price
- Type: Select type as an array
Step 4: Now we append the price to the variable; for this, click on the +New step -> select Append to array variable action. Then provide the below information:
- Name: Select the name of the variable
- Value: Select the value as price from dynamic content. This will automatically add Apply to each action to the flow.
Step 5: Then, to see the output, click on the +New step -> select Compose action. Then provide the below information:
- Inputs: Select the variable from dynamic content.
Step 6: Now run the flow by clicking on the run button, and you can see the array is created.
This is how to convert an integer from SharePoint to an array using Power automate
Conclusion
In this Power Automate tutorial, we saw how to convert integers to arrays using Power Automate. Also, we covered the below topics:
- How to convert an integer to an array using an array() in Power Automate
- How to convert an integer to an array using [] in Power Automate.
- How to convert integer string to Array using split() in Power Automate
- How to convert an integer to an array using createArray() in Power Automate
You may like the following tutorials:
- How to Convert Value to String in Power Automate?
- How to Format Numbers to Decimal Places Using 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