cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
confusedintern
New Member

Filter array doesn't work for document library?

Hi guys!

 

I'm trying to create an email notification that refreshes and sends every morning and will tell an individual when a safety data sheet (SDS) has expired.

 

So far this is what I have: 

confusedintern_0-1626660105593.png

confusedintern_1-1626660144993.png

Under filter array, this is what I've input:

formatDateTime(item()?['SDS_x0020_Expiry_x0020_Date'], 'yyyy-MM-dd') is equal to or less than 
addDays(utcNow(), 1, 'yyyy-MM-dd')
 
The flow can run, but when it does, the table shown in the email includes even the SDS that has NOT expired, so I guess the filter array didn't work?? I'm not so sure, but here is how the email looks like:
confusedintern_2-1626660273174.png

The one i arrowed is not supposed to be there 😞 

 

Sorry if this question is dumb, its my first time trying out flow automate!! Thanks for helping in advance!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-LilyW-msft
Microsoft
Microsoft

Hi @confusedintern 

The From value of Create HTML table should be filled with the body of the filter array.

vLilyWmsft_0-1626665966303.png

I created a simple Flow, you can refer to as below:

This is my file library:

vLilyWmsft_1-1626666112694.png

Flow in details:

vLilyWmsft_3-1626666165762.png

Expression:formatDateTime(item()?['SDSExpiryDate'],'yyyy-MM-dd')

Expression:addDays(utcNow(),-1,'yyyy-MM-dd')

vLilyWmsft_4-1626666184713.png

vLilyWmsft_6-1626666540725.png

vLilyWmsft_7-1626666591643.png

After flow runs, I will receive notification as below:

vLilyWmsft_8-1626666662612.png

Hope the content above may help you.

Best Regards

If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-LilyW-msft
Microsoft
Microsoft

Hi @confusedintern 

The From value of Create HTML table should be filled with the body of the filter array.

vLilyWmsft_0-1626665966303.png

I created a simple Flow, you can refer to as below:

This is my file library:

vLilyWmsft_1-1626666112694.png

Flow in details:

vLilyWmsft_3-1626666165762.png

Expression:formatDateTime(item()?['SDSExpiryDate'],'yyyy-MM-dd')

Expression:addDays(utcNow(),-1,'yyyy-MM-dd')

vLilyWmsft_4-1626666184713.png

vLilyWmsft_6-1626666540725.png

vLilyWmsft_7-1626666591643.png

After flow runs, I will receive notification as below:

vLilyWmsft_8-1626666662612.png

Hope the content above may help you.

Best Regards

If my solution 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 so much! This solution 100% works! This is how it looks like now:

confusedintern_0-1626672972034.png

 

Thanks again!

v-LilyW-msft
Microsoft
Microsoft

Hi @confusedintern 

Do you only want to display the date at expiry, not including the time?

If yes, you can change the Select action as below:

Expression:formatDateTime(item()?['SDSExpiryDate'], 'yyyy-MM-dd')

vLilyWmsft_0-1626674029796.png

Best Regards

Yes! that works as well. Thank you again!!!

 

confusedintern_0-1626676973480.png

 

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.

Users online (1,128)