cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TaylorW
Regular Visitor

SP List Yes/No and Date Column

I want to have a flow that runs every morning that checks a Sharepoint list of demo items. If an item is checked out (defined by a yes/no column named 'Checked Out') the flow checks the expected return date (Date/Time column formatted as date only, named 'Expected Return Date'). If the current date is 'Expected Return Date' or later, the flow sends an email to an admin with whatever item is meant to be returned.

 

I have the recurrence set up, and am grabbing the correct list. I tried the filter there to limit to only checked out items, but I don't think i used it right. Currently it grabs all items. Then there is an Apply to Each using the value for the list of items.

 

The evaluation condition is tripping me up here. I'm not sure how to get the Yes/no column to evaluate to true if it is checked out. Currently I have an and statement with two conditions. First condition gets the 'Checked Out' value, and is formatted to convert the value to true or false:

 

if(equals(item()['Checked Out'],'Yes'),true, false)

 

which is then compared by 'is equal to' true. This seems to be the main issue, so maybe this is the wrong way to check.

 

The second condition formats the date of the 'Expected Return Date' like so:

 

formatDateTime(item()['Expected Return Date'],'dd-mm-yyyy')

 

and checks if it is greater than or equal to today:

 

formatDateTime(utcNow(),'dd-mm-yyyy')

 

I've had "successful" runs but am not sending an email, but now it breaks at the Yes/No column check.

 

3 REPLIES 3
PrasadAthalye
Community Champion
Community Champion

Check yes no column like below... Convert it to bool and check if true or false....

 

PrasadAthalye_0-1613696370964.png

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
abm
Super User
Super User

Hi @TaylorW 

 

If your SharePoint column is boolean data type then you don't need to convert to boolean. Next your current date format expression is wrong. I can see you are using dd-mm-yyyy format. You need to use yyyy-MM-dd for comparisons. 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
tom_riha
Super User
Super User

Hello @TaylorW ,

you can filter the items directly in the 'Get items' action using the 'Filter Query' to get only the items that fit the filter. You'll need to know the internal names for 'Expected Return Date' and 'Checked out' and then you can build a composed filter query.

(CheckedOut eq 1) and (ExpectedReturnDate ge 'utcNow('yyyy-MM-dd')')

Notes:
CheckedOut and ExpectedReturnDate must be the columns internal names
1 represents the Yes value in Yes/No SharePoint column
utcNow('yyyy-MM-dd') is an expression to take today's date for the comparison, the whole expression must be in apostrophes

image.png

And are you sure you want to use greater than or equal on the return date? Greater = items with return date in the future, shouldn't you use less than or equal to get items with return date today or in the past?



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,510)