How to Convert an Integer to an Array in Power Automate?

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.

How to convert integer to Array Power Automate using array()

Then, provide the flow name and select Manually trigger a flow. Then click on Create.

How to convert integer to Array in Power Automate

You can see that a “Manually trigger a flow” action is added to the flow page.

Convert integer to Array in Power Automate using array()

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
Convert integer to array Power Automate using array()

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'))
Power automate convert integer to array

Step 4: Now run the flow manually, and you can see the integer is converted to an array.

Microsoft Power automate convert integer to array

This is how to convert an integer to an array using array () in Power Automate.

See also  Loop actions in Power Automate Desktop

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.

How to convert integer to Array Power Automate using []

Then, provide the flow name, and select “Manually trigger a flow” action. Then click on Create.

How to convert integer to Array in Power Automate

Now, you can see the “Manually trigger a flow” action is added to the flow page.

How to convert integer to Array in Power Automate using []

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:

NameTypeValue
num 1Integer23
num 2Integer24
Convert integer to an Array Power Automate using []

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]
Convert integer to Array Power Automate using []

Step 4: Now run the flow manually, and you can see the integer is converted to an array.

How to convert integer to Array Power Automate using []

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.

How to convert integer to Array Power Automate

Then, provide the flow name and select Manually trigger a flow. Then click on Create.

How to convert integer to Array in Power Automate

Now you can see “Manually trigger a flow” is added to the flow page.

Convert integer to Array Microsoft Power Automate

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)
Convert integer to Array Power Automate

Step 3: Now run the flow manually and you can see the integer is converted to an array.

Convert integer to an Array Power Automate

This is how we can convert integer to an array using createArray() in Power Automate.

See also  How to Convert String to Date 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.

How to convert integer to Array Power Automate using split()

Then, provide the flow name and select Manually trigger a flow. Then click on Create.

How to convert integer to Array in Power Automate

You can see that a “Manually trigger a flow” action is added to the flow page.

Convert string integer to Array using split() Power Automate

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
How to convert string integer to Array using split() Power Automate

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'),',')
How to convert string integer to Array using split() in Power Automate

Step 4: Now run the flow manually, and you can see the integer is converted to an array.

Convert string integer to Array using split() Microsoft Power Automate

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.

Using Microsoft Power Automate convert integer to array

To do this in Power Automate, follow the below steps

See also  An entry without a type name was found, but no expected type was specified. to allow entries without type information, the expected type must also be specified when the model is specified

Step 1: Open Power Automate Cloud, click on +Create and select Instant Cloud flow.

How to convert integer to Array Power Automate using split()

Then, provide the flow name, and select Manually trigger a flow. Then click on Create.

How to convert integer to Array in Power Automate

Now, you can see the “Manually trigger a flow” action is added to the flow page.

Convert string integer to Array using split() Power Automate

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

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
Using Power Automate convert integer to 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.
 convert integer to array using Power Automate

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.
convert integer to array using Microsoft Power Automate

Step 6: Now run the flow by clicking on the run button, and you can see the array is created.

How to convert integer to array using Microsoft Power Automate

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:

>