I initialize the variable ApplytoeachOutput to an array, then set it to the array from the selection in the "Apply to each" loop, all looks fine in the loop. However, when I call the ApplytoeachOutput outside the loop, it has the same amount of items, yet the value is repeating the last row. Any idea what is the proper way to get the selected data out of the "Apply to each" loop?
Solved! Go to Solution.
You have to replace your "Set variable" action by "Append to array". If you want to, you can also get rid of the SelectItem action and replace it by the following formula in "Append to array":
{
"ID": @item()?['ID'],
"Title": @item()?['Title']
}
and so on, just insert your own need columns. The "@"-mark means it has to be insertes by expression editor.
You have to replace your "Set variable" action by "Append to array". If you want to, you can also get rid of the SelectItem action and replace it by the following formula in "Append to array":
{
"ID": @item()?['ID'],
"Title": @item()?['Title']
}
and so on, just insert your own need columns. The "@"-mark means it has to be insertes by expression editor.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
253 | |
122 | |
84 | |
84 | |
67 |