cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FlowQs
Microsoft
Microsoft

Obtaining a filtered Sharepoint list based off a column

Hi,

 

I am trying to email a filtered SP list (filtered on a column). But when I use condition, what would be a straight forward way to consolidate the filtered results in a table that can be emailed?

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
liviuo
Power Automate
Power Automate

You can consider filtering the items directly from the source by using ODATA filtering like below.list.png

Alternatively, for filtering, especially when you have a complex condition, you can use the filter array action to filter the output of a previous action.

filter.png

 

 

 

If the e-mail looks a bit unpolished the simplest thing to do is to add some html styling like this:

 

 

list2.png

 

View solution in original post

v-micsh-msft
Community Support
Community Support

Hi @FlowQs,

 

So here you are using the condition to flter the column?

Using condition to fitler the Get items result would make the result into record, and currently there is no way to combine those records into a table.

You may consider take use of the filter Array action, which would contain the filter condition, and return the result as an array, 

Filter arrarys

In addition, OData query should also be used in such a situation.

OData query for SharePoint lists reference

For example, if you would like to filter a Title field where this fields euqals to string "Name", under the Filter Query Input box, write down the following:

Title eq 'Name'

This would also work to return the results as a whole.

With the result returned in an array, then we could take use of the Create HTML table action, check the blog below for more details:

Build flows with HTML Tables, CSVs and other new features like OCR and image content detection

Post back if you need any further assistance.

Regards,

Michael

Community Support Team _ Michael Shao
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

7 REPLIES 7
liviuo
Power Automate
Power Automate

You can consider filtering the items directly from the source by using ODATA filtering like below.list.png

Alternatively, for filtering, especially when you have a complex condition, you can use the filter array action to filter the output of a previous action.

filter.png

 

 

 

If the e-mail looks a bit unpolished the simplest thing to do is to add some html styling like this:

 

 

list2.png

 

View solution in original post

v-micsh-msft
Community Support
Community Support

Hi @FlowQs,

 

So here you are using the condition to flter the column?

Using condition to fitler the Get items result would make the result into record, and currently there is no way to combine those records into a table.

You may consider take use of the filter Array action, which would contain the filter condition, and return the result as an array, 

Filter arrarys

In addition, OData query should also be used in such a situation.

OData query for SharePoint lists reference

For example, if you would like to filter a Title field where this fields euqals to string "Name", under the Filter Query Input box, write down the following:

Title eq 'Name'

This would also work to return the results as a whole.

With the result returned in an array, then we could take use of the Create HTML table action, check the blog below for more details:

Build flows with HTML Tables, CSVs and other new features like OCR and image content detection

Post back if you need any further assistance.

Regards,

Michael

Community Support Team _ Michael Shao
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

Thank you for the help! I was able to filter the data and generate the mail with a consolidated list.

However, the columns in the table within the mail lose their sorting. They seemed to be sorting in alphabetical order. I tried renaming the columns in the original SP list, but the sort order is still retained for some reason.

 

 

Hi @FlowQs,

 

Based on what I know, currently there is no proper way to custom the HTML Table format.

 This has been asked in the forums before:

Customize output of Create HTML Table Action

Which I suggest to submit this as an idea in the flow idea forum.

Regards,

Michael

 

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

Thank you.

Hi @FlowQs,

 

Do you need any further help on this issue?

If not, would you please Accept the proper posts as the solution to close this thread?

 

Regards,

Michael

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

@v-micsh-msft Thank you for your posts in this thread, it has been very usefull. I wanted to ask, how can I use the OData filter in the case of a lookup field e.g. in your example you used Title eq 'something'

 

What would be the syntax if I wanted to use a lookup field called InvoiceNumber which is a lookup?

 

I would want to use the ID value of the lookup

 

would it be something like Invoice.ID eq '100'

 

Thanks. 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,752)