web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Searching a List for a...
Power Automate
Unanswered

Searching a List for all related Outputs and Passing through to a table

(0) ShareShare
ReportReport
Posted on by 2

Hi All, I had posted this question before but my post seems to have been removed.

 

I am struggling with what I think is a very simple task which I am not able to find the right method to achieve.

 

I have an array built from a sharepoint list which includes project manager names and project numbers. I am trying to reduce the size of the html table at the end of the flow by combining the output of same name PMs into one line. 

 

I have used  select and 'union' to reduce the duplicates in the array as well.  Here's an example of what I am trying to do:


Original Table

PM        #

David 12345

David 6789

Mike 111

Mike 222

Zack 000

 

Desired Output (Transposed?)

PM          #

David 12345, 6789

Mike 111, 222

Zack 000

 

I've spent a lot of time on this and can't see the solution, but I admit I am a relatively basic Power Automate user. 


Can anyone help?

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @wee_georgie 

     

    Here is the sample flow which will help you getting the desired html table from an array.

     

    I have stored the input array in a compose action:

    ManishSolanki_0-1696646904088.png

     

    Next, initialize an array variable 'OutputArray' that holds the output:

    ManishSolanki_1-1696646969300.png

     

    Add "Select" action to create an array of PMs:

    ManishSolanki_2-1696647081468.png

    Expression used in the above screenshot. Expression needs to be entered in the expression box as highlighted in the above screenshot:

    item()?['PM']

     

    Next, add "Apply to each" action to get unique PMs & we will write an expression using union function to achieve this:

    ManishSolanki_3-1696647238224.png
    union(body('Select'),body('Select'))

     

    Continue in Apply to each action block, add "Filter array" action that will search for PM record in original array using query. This action will return the record(s) for unique PM in each iteration:

    ManishSolanki_4-1696647430895.png

    To add filter query, click "Edit in advanced mode" button on the bottom of filter array action and enter the query in the box:

    @equals(item()?['PM'], items('Apply_to_each')?['PM'])

     

    Add another "Select" action to create an array of column '#' for each PM. Pass the output of filter array action as input to select action. Click on "Switch Map to text mode" bottom on the right side & write an expression in the Map box:

    ManishSolanki_6-1696647727452.pngManishSolanki_7-1696647765334.pngManishSolanki_8-1696647823042.png
    item()?['#']

     

    Add "Append to array variable" action in the apply to each action block:

    ManishSolanki_9-1696647894470.png
    {
    "PM":@{items('Apply_to_each')?['PM']},
    "#":@{join(body('Select_2'),', ')}
    }

     

    Finally, add Create HTML table action to get the desired table. Pls note that this action should be added outside of apply to each action block:

    ManishSolanki_10-1696647988159.png

     

     

    The output obtained after executing the flow:

    ManishSolanki_11-1696648033966.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

     

  • wee_georgie Profile Picture
    2 on at

    Wow, @ManishSolanki  thank you so much for putting the time into that. I will try this out on Monday and get back to you!

     

    Thank you again

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard