cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Radoslavov
Continued Contributor
Continued Contributor

Get output from apply to each

Hi All,

 

I've reached the following "blocker" in my project.

 

I have applied to each step which collects start and end dates from a calendar.

I'm trying now to pass these parameters to PVA (Power Virtual Agent)

However, i cannot refer to the values of applying to each, but only to the Current Item.

So my idea here is te following

For each of the results here:

Radoslavov_0-1608637622394.png

To get the outputs for Start and End time steps,

in my case, these will be a list of a total of 18 rows in the format Start Time xxxxx - End Time xxxxxxxx

Inside the Apply to each, I cannot use Initialize Variable so the must be something else to get these 18 outputs.

Any suggestions?

 

Regards

Kiril

1 ACCEPTED SOLUTION

Accepted Solutions
ManishJain
Solution Sage
Solution Sage

Hi @Radoslavov ,

 

It should be outputs('Composed_time') .

 

Thanks

View solution in original post

4 REPLIES 4
ManishJain
Solution Sage
Solution Sage

Hi @Radoslavov ,

 

The unique feature of using Compose inside apply to each loop is that if accessed outside loop it gives you output in array. So you can use one compose action with formatted date as you want like Start Date : End Date and then outside of loop use compose action with output as outputs('Compose').

 

Thanks

Radoslavov
Continued Contributor
Continued Contributor

Hi @ManishJain ,

 

I've tried this and it didn't work, perhaps I'm doing something wrong:

Radoslavov_1-1608709789600.png

Radoslavov_2-1608709806056.png

outputs('Apply_to_each')['Composed_time']
 
But I got the following error 
Radoslavov_3-1608710245849.png

InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '15787': 'The template language expression 'outputs('Apply_to_each')['Composed_time']' cannot be evaluated because property 'Composed_time' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.

ManishJain
Solution Sage
Solution Sage

Hi @Radoslavov ,

 

It should be outputs('Composed_time') .

 

Thanks

Radoslavov
Continued Contributor
Continued Contributor

It's workiiiiiiiiiiiiiiiiiiing 🙂 

 

Thank you so much @ManishJain 

 

"Start Date: 2020-12-24T18:00:00.0000000 - End Date: 2020-12-24T18:30:00.0000000",
  "Start Date: 2020-12-24T00:00:00.0000000 - End Date: 2020-12-24T00:30:00.0000000",
  "Start Date: 2020-12-24T00:30:00.0000000 - End Date: 2020-12-24T01:00:00.0000000",
  "Start Date: 2020-12-24T17:00:00.0000000 - End Date: 2020-12-24T17:30:00.0000000",
  "Start Date: 2020-12-24T17:30:00.0000000 - End Date: 2020-12-24T18:00:00.0000000",
  "Start Date: 2020-12-24T18:30:00.0000000 - End Date: 2020-12-24T19:00:00.0000000",
  "Start Date: 2020-12-24T19:30:00.0000000 - End Date: 2020-12-24T20:00:00.0000000",
  "Start Date: 2020-12-24T20:00:00.0000000 - End Date: 2020-12-24T20:30:00.0000000",
  "Start Date: 2020-12-24T20:30:00.0000000 - End Date: 2020-12-24T21:00:00.0000000",
  "Start Date: 2020-12-24T23:00:00.0000000 - End Date: 2020-12-24T23:30:00.0000000",
  "Start Date: 2020-12-24T21:30:00.0000000 - End Date: 2020-12-24T22:00:00.0000000",
  "Start Date: 2020-12-24T22:30:00.0000000 - End Date: 2020-12-24T23:00:00.0000000",
  "Start Date: 2020-12-24T22:00:00.0000000 - End Date: 2020-12-24T22:30:00.0000000",
  "Start Date: 2020-12-24T23:30:00.0000000 - End Date: 2020-12-25T00:00:00.0000000",
  "Start Date: 2020-12-24T21:00:00.0000000 - End Date: 2020-12-24T21:30:00.0000000"
]

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,313)