cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lucian
Advocate II
Advocate II

Condition is not evaluated correctly for a numeric SharePoint calculated column

Hello,

 

I have a flow that should export some information into an Excel file depending on a numeric SharePoint calculated column.

Basically that column will evaluate some records and if the record is considered "valid" will return 1 and if the record is considered invalid will return 0.

 

 Cond1.png

 

But this evaluation will always evaluate to false.

I have tried to put the 1 as '1' no luck.

 

The strange thing is that I have another flow, using the same logic where that condition is evaluated correctly.

When I have copied the condition from the other flow it evaluates correctly - WHY?... because is the same field compared to the same type of value.

 

Cond2.png

 

I have recreated the same Apply to each loop but with initial condition card is never evaluates to true, but with the copied condition card is evaluating correctly.

I have lost about 2 hours trying to understand WHY... but I cannot find any reason. Is there any "logical reason" I should take care of in the future?

Unfortunately for the condition cards and loops you cannot "peek code" so maybe there I would find some reasons...

 

Also after 2 hours of digging I found another workaround: MS Flow - condition wrongly evaluates on calculated column but it seems to much "work" to use that compose action before condition.

 

Is there anything am I missing?

 

Kind Regards,

Lucian

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User II
Super User II

Hi @Lucian,

 

Can you replace the InregistrateValida field by the following expression. This will use an int function to convert the calculated column value from 1.0000000 to 1. With this workaround your condition should be evaluated as true.

 

int(items('Apply_to_each')?['InregistrareValida'])

 

expression_calculatedcolumn.png

View solution in original post

3 REPLIES 3
Expiscornovus
Super User II
Super User II

Hi @Lucian,

 

Can you replace the InregistrateValida field by the following expression. This will use an int function to convert the calculated column value from 1.0000000 to 1. With this workaround your condition should be evaluated as true.

 

int(items('Apply_to_each')?['InregistrareValida'])

 

expression_calculatedcolumn.png

View solution in original post

Lucian
Advocate II
Advocate II

Hi @Expiscornovus ,

 

Thank you for your suggestion which is better than another card with compose, but why in the same condition created manually into a flow does work without any other tricks, and in a new flow this would no longer work?

 

Kind Regards,

Lucian

Expiscornovus
Super User II
Super User II

Hi @Lucian,

 

From experience I know sometimes the calculated columns don't render properly (showing up as a float instead of an integer). But I don't know what the root cause of this is. 

 

If you do want to know you might be able to contact Microsoft Support about this via a service request. They might be able to investigate the root cause in the SharePoint connector.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,447)