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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Filtering a New HTML Table

(0) ShareShare
ReportReport
Posted on by 26

Hi All,

 

I am currently building a flow that takes a list of bookings into a table and then emails a daily schedule to each Team member (Interviewer) of the interviews they have each day.

I have the html table built and it attaches to the email okay, but I want to be able to send different tables to different people.

I have tried a few ways to filter the table but none seem to work and each email just sends a full list.

Something I'm doing wrong (most likely!)?

 

See attached flow.. output I would like to be Sophie gets an email showing her bookings, Chris gets one showing his bookings.

 

ChrisDMU_0-1676996701887.png

 

I have the same question (0)
  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Filtering a New HTML Table

    Hello @ChrisDMU 

     

    You use „Filter array“ but in the select action you use the wrong input. Try to use the output of „Filter array“ instead of the „HTML Table“.

  • ChrisDMU Profile Picture
    26 on at
    Re: Filtering a New HTML Table

    Hi Matthy, the output of Filter Array is "Body".. I tried that but still no filtering happens.

    ChrisDMU_0-1677066259748.png

     

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Filtering a New HTML Table

    Hello @ChrisDMU 

     

    The filter array action doesn't contain an item value in the condition. So in this case it goes through all the items and check if the variable "Interviewer" contains "Chris". If it does, every item from "HTML Table" would be in the result. If it doesn't the array would be empty.

     

    You have to put in some information of each item to compair to. Like "@equals(item()['Interviewer'], variables('Interviewer'))"

    Matthy79_0-1677068319900.png

    Change the "filter array" action and resubmit the flow. Check the output of "filter array" by using the flow history. You also don't need the "Select" action I think because you don't want to change anything, do you?

  • ChrisDMU Profile Picture
    26 on at
    Re: Filtering a New HTML Table

    Thanks Matthy,

    It seems to have worked, but not quite sure how, as I have not put "Chris" in anywhere! 😄

     

    ChrisDMU_0-1677070757364.png

     

     

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Filtering a New HTML Table

    I think "Chris" is the value of the variable "Interviewer" 😉

  • ChrisDMU Profile Picture
    26 on at
    Re: Filtering a New HTML Table

    I have a number of different interviewers, how would i replicate this for interviewer "Sophie"?

    Can't see anything specifically pointing to Chris in any of the variables

     :S 

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Filtering a New HTML Table

    I don't know what your input is and I don't know what dynamic content you have available so it is not easy to help because I am just guessing.

     

    I was guessing that you created categories you called "Chris", "Sophie" and so on and in the variable "Interviewer" you put in the value of this categories. Of course you could use the names in the filter conditions (like this "@equals(item()['Interviewer'], 'Chris')") but I'm not sure what your plan is with the different branches. From the description you have a list of people receiving the same mail with different filters. I would use an "apply to each" action so you won't have to write everything multiple times.

     

    It would be much easier with a little more information.

     

    Where are the names stored you want to send mails to, where do you get the mail addresses, how do you built the html table, maybe some sample data.

  • ChrisDMU Profile Picture
    26 on at
    Re: Filtering a New HTML Table

    Sorry Matthy, wasnt clear before.

    The categories "Chris", "Sophie", etc come from Set Interviewer variable which is finding "Category" from a booking.

    The idea is i get a few tables built and then email to each person. The email bit i was going to have just written into the Send an Email (V2) flow, and have 6 or 7 of them.

    I have attached some screenshots if that's easier?

     

    ChrisDMU_1-1677159978552.png

     

     

    ChrisDMU_0-1677159522372.png

     

  • Verified answer
    Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Filtering a New HTML Table

    Without knowing the structior of all the data it is difficult to answer. But here you have a sample of how I would build the flow.

     

    {"id":"a06bd189-468e-4e26-8f22-c4159561c014","brandColor":"#8C3900","connectionReferences":{},"connectorDisplayName":"Control","icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZlcnNpb249IjEuMSIgdmlld0JveD0iMCAwIDMyIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPg0KIDxwYXRoIGQ9Im0wIDBoMzJ2MzJoLTMyeiIgZmlsbD0iIzhDMzkwMCIvPg0KIDxwYXRoIGQ9Im04IDEwaDE2djEyaC0xNnptMTUgMTF2LTEwaC0xNHYxMHptLTItOHY2aC0xMHYtNnptLTEgNXYtNGgtOHY0eiIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=","isTrigger":false,"operationName":"Scope_Email","operationDefinition":{"type":"Scope","actions":{"Compose_People":{"type":"Compose","inputs":[{"Name":"Chris","Email":"Chris@whatever.com"},{"Name":"Sophie","Email":"Sophie@whatever.com"},{"Name":"Michael","Email":"Michael@whatever.com"}],"runAfter":{}},"Compose_Sample_Data":{"type":"Compose","inputs":[{"Interviewer":"Chris","Info":"This is a task for Chris"},{"Interviewer":"Sophie","Info":"This is a task for Sophie"},{"Interviewer":"Chris","Info":"One more for Chris"},{"Interviewer":"Sophie","Info":"And one more for Sophie"}],"runAfter":{"Compose_People":["Succeeded"]}},"Apply_to_each_Person":{"type":"Foreach","foreach":"@outputs('Compose_People')","actions":{"Filter_Tasks_for_Person":{"type":"Query","inputs":{"from":"@outputs('Compose_Sample_Data')","where":"@equals(item()['Interviewer'], items('Apply_to_each_Person')['Name'])"},"runAfter":{}},"Compose_Mail":{"type":"Compose","inputs":"Here you send a mail to @{items('Apply_to_each_Person')['Name']} (@{items('Apply_to_each_Person')['Email']})\n\nNumber of Interviews for today: @{length(body('Filter_Tasks_for_Person'))}\n\n@{join(body('Select_Info_from_Task'), '\r\n')}","runAfter":{"Select_Info_from_Task":["Succeeded"]}},"Select_Info_from_Task":{"type":"Select","inputs":{"from":"@body('Filter_Tasks_for_Person')","select":"@item()['Info']"},"runAfter":{"Filter_Tasks_for_Person":["Succeeded"]}}},"runAfter":{"Compose_Sample_Data":["Succeeded"]}}},"runAfter":{}}}

    I hope this clears some things up. Just put it in a new testflow and run it.

     

    Of course you have to select some other input and create formated different output but the way to go should be clearer. And you can turn on "Concurrency Control" to speed things up.

  • Matthy79 Profile Picture
    4,178 Super User 2024 Season 1 on at
    Re: Filtering a New HTML Table

    Hi. I am not able to import this flow. You can try to export it as a unmanaged solution and send it to me. I need a zip-file or json parts of the flow (like I posted it).

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard