cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Power Participant
Power Participant

Join table from Apply to each item

Hi im trying to get everything from all my items in a apply to each into one big html table.

Im not sure how i can join the data from each item?

 

2020-03-22 19_07_30-Run History _ Power Automate.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Join table from Apply to each item

Hi again!

I  have implemented the following flow:

Flow_TableCreateFileStatus.png

The expression assigned to 'Append to array' is

setProperty(setProperty(json('{}'),'File',body('Create_file')?['Name']),'Status',outputs('Create_file')['statusCode'])

Please also note 'Create HTML table' is outside the 'Apply to each'

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

8 REPLIES 8
Highlighted
Dual Super User III
Dual Super User III

Re: Join table from Apply to each item

Hi!

Can you please share a screenshot of your current flow design?

Since you mention you need 'one big HTML table' I guess you will need to add a Select action block out of your Apply to each, also move 'Create HTML table' after Select, but it 's difficult to say without a screenshot of your current flow design

Thanx!.

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Power Participant
Power Participant

Re: Join table from Apply to each item

@efialttes

I already shared the screenshot of the flow.

 

Im collecting the statusCode in an array to see if each item was created successfully.

In my compose i have: 

 

 

array(outputs('Create_file')['statusCode'])

 

 

 

I collect that in a html table, but i get it for each item and i want to join them into one big table instead so i get an output like this.

 

Filename1.pdf200 (OK)
Filename2.pdf200 (OK)
Filename3.pdfFailed
  
Highlighted
Dual Super User III
Dual Super User III

Re: Join table from Apply to each item

Hi!

I was asking for a screenshot of your flow design. You shared a screenshot from your flow execution.

Anyway, I think I have enough info. Give me some minutes

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Dual Super User III
Dual Super User III

Re: Join table from Apply to each item

Hi again!

I  have implemented the following flow:

Flow_TableCreateFileStatus.png

The expression assigned to 'Append to array' is

setProperty(setProperty(json('{}'),'File',body('Create_file')?['Name']),'Status',outputs('Create_file')['statusCode'])

Please also note 'Create HTML table' is outside the 'Apply to each'

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Power Participant
Power Participant

Re: Join table from Apply to each item

@efialttes Thank you i will try this now and let u know if it works 🙂

Highlighted
Power Participant
Power Participant

Re: Join table from Apply to each item

@efialttes THANK YOU so much man. This solved it.

Got my nice output.

 

Sorry to say but i messed up. I get the data i wanted as i explained. But i have another apply to each.

My flow lets the user first select multiple files, then multiple locations. So it will publish the files to multiple locations so i will now receive the data like this. And this is what i asked for so im very thankful for the help 🙂

 

File Status

ACP 001 Intro.pdf200
ACP 001 Intro.pdf200
Document.docx200
Document.docx200

 

I would need the data like this. And this is because we see the files are published twice but not to the same location. Im sorry but i dont really know how to use setproperties and arrays

File Status

Location ti published to
ACP 001 Intro.pdf200Location ti published to
ACP 001 Intro.pdf200Location ti published to
Document.docx200Location ti published to
Document.docx200 

 

2020-03-22 21_32_54-Run History _ Power Automate.png

Highlighted
Power Participant
Power Participant

Re: Join table from Apply to each item

@efialttes trying to add the Create_file, Site Address after the Status. But I'm falling on how to get the input. I atleast understand setProperty now 🙂

 

Got it now if i use 

 

setProperty(setProperty(setProperty(json('{}'),'File',body('Create_file')?['Name']),'Status',outputs('Create_file')['statusCode']),'Course',item())

 

I will get all the data i need except the last part does not look formatted well. 
How do i remove the part that says CourseLink or maybe i should not get the item() ? It is the location the file is created at

 

File Status Course

Filetest.pdf200{"CourseLink":"https://xxxxxxxxxxxxxxxxxxxxxxx"}
Filetest.pdf200{"CourseLink":"https://xxxxxxxxxxxxxxxxxxxxxxxxxx"}
filetest.docx200{"CourseLink":"https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
filetest.docx200{"CourseLink":"https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
Highlighted
Power Participant
Power Participant

Re: Join table from Apply to each item

@efialttes I got it now, a big thank you for making me understand setProperty also 🙂

 

setProperty(setProperty(setProperty(json('{}'),'File',body('Create_file')?['Name']),'Status',outputs('Create_file')['statusCode']),'Course',items('Apply_to_each_2')['CourseLink'])

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,742)