cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

create array in apply each

how i can create an array with some data in apply to each function? in "choixDateUser" i have 2 items.

 

Capture d’écran 2017-10-16 à 22.01.11.png

i want to put in an array : "Compose 22 output"  for each item

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @7eleven,

 

Do you want to put “Compose 22 output” for each item into same array?

Further, could you please show a bit more about the "choixDateUser"?

Firstly we need to initialize an empty array. Please take a try with the following workaround:

  • Add a proper trigger, here I use Flow button trigger.
  • Add “Compose” action, Inputs set to following formula:
@createArray(utcNow(),addDays(utcNow(),2))
  • Add Variables-> “Initialize variable” action, Name set to choixDateUser, Type set to Array, Value set to output of above “Compose” action.
  • Add Variables-> “Initialize variable 2” action, Name set to InputArray, Type set to Array, Value set to null.
  • Add “Apply to each”, input parameter set to array choixDateUser.
  • Within “Apply to each”, add “Compose 2” action, Input set to following formula:
@addHours(item(),2)
  • Add “Compose 3” action, Input set to following formula:
@createArray(join(variables('InputArray'),''),outputs('Compose_2'))
  • Add “Set variable” action, Name set to InputArray, Value set to output of “Compose 3” action.

Image reference:7.JPG

 

8.JPG

 

9.JPG

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @7eleven,

 

Do you want to put “Compose 22 output” for each item into same array?

Further, could you please show a bit more about the "choixDateUser"?

Firstly we need to initialize an empty array. Please take a try with the following workaround:

  • Add a proper trigger, here I use Flow button trigger.
  • Add “Compose” action, Inputs set to following formula:
@createArray(utcNow(),addDays(utcNow(),2))
  • Add Variables-> “Initialize variable” action, Name set to choixDateUser, Type set to Array, Value set to output of above “Compose” action.
  • Add Variables-> “Initialize variable 2” action, Name set to InputArray, Type set to Array, Value set to null.
  • Add “Apply to each”, input parameter set to array choixDateUser.
  • Within “Apply to each”, add “Compose 2” action, Input set to following formula:
@addHours(item(),2)
  • Add “Compose 3” action, Input set to following formula:
@createArray(join(variables('InputArray'),''),outputs('Compose_2'))
  • Add “Set variable” action, Name set to InputArray, Value set to output of “Compose 3” action.

Image reference:7.JPG

 

8.JPG

 

9.JPG

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

thanks for the tip 

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (101,397)