cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crirojsab
Helper I
Helper I

Process Multiple Items in one Field of Text

Hello:

 

I'm in the process of create Flow where is required process that runs in a cycle for each of the items. Example: 

 

crirojsab_0-1628619310403.png

In the attach image I need to process the flow for each of the PGD Centers but at the same time for each center I need to assign all the Audit rules. 

 

I was thinking use apply to each because at the time of read the data clearly Power Automate make a difference of each of the PGD Center Values in the Sharepoint Field. Example: 

 

{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 5,
"Value": "PGD Lebanon"
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 3,
"Value": "PGD Costa Rica"
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "PGD Argentina"
}
]

 

I even thought in add the values into one array but then had the problem that i don't have a clue on how to process the array. More than appreciated any help that you can provide.

Regards

crirojsab 

 

1 ACCEPTED SOLUTION

Accepted Solutions
poweractivate
Community Champion
Community Champion

@crirojsab 

 

Using a sample Array of Objects similar to yours (had to change it slightly for testing since using a dummy Compose), you can process like this:

 

1) use Apply to Each

2) Use an expression like this:

 

 

 

 

items('Apply_to_each')['Value']

 

 

 

 

Check if it helps.

 

Example:

 

Sample Flow Definition:

 


81221-f02.png

 

Sample Input, which is:

 

 

 

 

[
{
"something": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 5,
"Value": "PGD Lebanon"
},
{
"something": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 3,
"Value": "PGD Costa Rica"
},
{
"something": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "PGD Argentina"
}
]

 

 

 

 

 

the, entering into an Apply to Each:

81221-f03.png

"Outputs" under "Select an output from previous steps" in Apply to Each is the "Outputs" from "Compose" above (i.e. the test/dummy array) for which the Apply to Each is iterating over.

Compose 2 shows "Current item" - which I picked from Dynamic Content - this is here for illustration purposes. "Current item" here is actually equivalent to

 

 

 

 items('Apply_to_each')

 

 

 

 

So, to process it, let's just access the value directly, like this:

 

 

 

 

items('Apply_to_each')['Value']

 

 

 

The expression 

81221-f04.png

is here in Compose 3 in this example - and something like this is the one that you should use in your case to access the value directly.

 

Below, check a test Flow run to see the results:

 

Test Run Result (it works):

 

81221-f01.png

 

Notice "PGD Lebanon" as the output of Iteration #1 of the Apply to Each of the test run above.  Only Iteration #1 is shown, but there are actually 3 iterations in this example. When checking the other Iterations, they show the correct expected values for those, too!

 

Check if something like this helps you.

 

 

 

 

View solution in original post

1 REPLY 1
poweractivate
Community Champion
Community Champion

@crirojsab 

 

Using a sample Array of Objects similar to yours (had to change it slightly for testing since using a dummy Compose), you can process like this:

 

1) use Apply to Each

2) Use an expression like this:

 

 

 

 

items('Apply_to_each')['Value']

 

 

 

 

Check if it helps.

 

Example:

 

Sample Flow Definition:

 


81221-f02.png

 

Sample Input, which is:

 

 

 

 

[
{
"something": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 5,
"Value": "PGD Lebanon"
},
{
"something": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 3,
"Value": "PGD Costa Rica"
},
{
"something": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "PGD Argentina"
}
]

 

 

 

 

 

the, entering into an Apply to Each:

81221-f03.png

"Outputs" under "Select an output from previous steps" in Apply to Each is the "Outputs" from "Compose" above (i.e. the test/dummy array) for which the Apply to Each is iterating over.

Compose 2 shows "Current item" - which I picked from Dynamic Content - this is here for illustration purposes. "Current item" here is actually equivalent to

 

 

 

 items('Apply_to_each')

 

 

 

 

So, to process it, let's just access the value directly, like this:

 

 

 

 

items('Apply_to_each')['Value']

 

 

 

The expression 

81221-f04.png

is here in Compose 3 in this example - and something like this is the one that you should use in your case to access the value directly.

 

Below, check a test Flow run to see the results:

 

Test Run Result (it works):

 

81221-f01.png

 

Notice "PGD Lebanon" as the output of Iteration #1 of the Apply to Each of the test run above.  Only Iteration #1 is shown, but there are actually 3 iterations in this example. When checking the other Iterations, they show the correct expected values for those, too!

 

Check if something like this helps you.

 

 

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,743)