cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Flow returning expression result false in below scenario

Hi,

I have a below SharePoint list for which I am trying to build a simple flow based on following condition.

When the comp credit expiration date field value is today's date and Comp Credit Status value equals to Pending then, I would like to set the Comp Credit Status value to "Expired".

 

Please note that the Comp Credit  expiration date is a date field and Comp Credit Status value is a free text column (it actually comes from another list's calculcated column using a different flow).

Capture.PNGI added a flow as below and it runs successfully but for some reason I am always seeing the expression result as false. I manually set the Comp Credit expiration date to 9/27 (in the list for testing) to match today's date but still it says expression result as false. Maybe I am doing a stupid mistake here but can someone please help me fix this.

Capture.PNGCapture.PNG

I tried the equals instead of lessOrEquals for the first part of condition but still no luck. Please help. Again the logic is if the date matches utcnow and status eqauls pending then set the status field to expired.

P.S. I tried Contains as well for the status field since its a free text but still same issue. THanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you want to filter items that Credit expiration date is equals to Today’s date and Credit status equals to Pending then update the Credit status to Expired?

What’s the column type of Comp Credit status? Is it a Text column or Choice column?

What’s the date format that displayed on Flow? Please add a Compose action to get the correct date format in flow, is it “MM/dd/yyyy” or “dd/MM/yyyy”?

I have made the following test. In the list, Credit Expiration is Date column with format “MM/dd/yyyy”, and Credit status is of Text type.

The condition is configured likes below:

@and(equals(items('Apply_to_each')?['ExpirationDate'], utcnow('yyyy-MM-dd')),equals(items('Apply_to_each')?['CreditStatus'],'Pending'))

Note: Please make sure the column names are correct, and the comparing two dates should have the same format.

As you can see, the return format of column Expiration date is “yyyy-MM-dd”, so I configured utcnow with the same format.

2.PNG1.PNG3.PNG

It works fine. Please take it for a reference and try again with it on your side.

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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

1 REPLY 1
v-yamao-msft
Community Support
Community Support

Hi @Anonymous,

 

Do you want to filter items that Credit expiration date is equals to Today’s date and Credit status equals to Pending then update the Credit status to Expired?

What’s the column type of Comp Credit status? Is it a Text column or Choice column?

What’s the date format that displayed on Flow? Please add a Compose action to get the correct date format in flow, is it “MM/dd/yyyy” or “dd/MM/yyyy”?

I have made the following test. In the list, Credit Expiration is Date column with format “MM/dd/yyyy”, and Credit status is of Text type.

The condition is configured likes below:

@and(equals(items('Apply_to_each')?['ExpirationDate'], utcnow('yyyy-MM-dd')),equals(items('Apply_to_each')?['CreditStatus'],'Pending'))

Note: Please make sure the column names are correct, and the comparing two dates should have the same format.

As you can see, the return format of column Expiration date is “yyyy-MM-dd”, so I configured utcnow with the same format.

2.PNG1.PNG3.PNG

It works fine. Please take it for a reference and try again with it on your side.

 

Best regards,

Mabel Mao

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

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,389)