cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Calculated Column value in SharePoint List displays wrong value when used in Compose action in Microsoft Flow

Hello All,

I have a rather large Flow that handles approvals for leave requests based on leave type, which works perfectly fine. I also have another Flow that handles updating leave balances in another SharePoint List after leave requests are approved. However, in this second Flow, there are delays in processes as the trigger relies on "When an item is created or modified", and sometimes it doesn't kick off. Therefore, I have decided to merge the actions from this Flow into the first Flow that handles the approvals, and just update the employee's balances right after the Status changes to "Approved".

So, in altering the approval Flow, I have placed a number of calculated column values in Compose actions, since I've realized that this method returns the "correct" values (I speak from experience). However, there are two particular column values that have been returning the wrong numbers. I cannot figure out why this is happening, as the other Compose actions returns the correct values. Please see the below images:

 

This is the SharePoint List that contains the calculated valuesThis is the SharePoint List that contains the calculated values

 

This is the result of a flow run that displays correct valuesThis is the result of a flow run that displays correct values

 

This is the result of a flow run that displays the wrong valuesThis is the result of a flow run that displays the wrong values

 

Please note the differences between the "TotalDaysRemaining" and "TotalTimeTaken" values in comparison to the values in the image of the SharePoint List above. The following are the formulas for the calculations in the SharePoint List for these columns:

1. "TotalDaysRemaining": =BalanceCopy-TotalDaysTaken (which returns a number to 1 decimal place)

2. "TotalTimeTaken": =BalanceCopy-[Time Taken (hrs)] (which returns a number to 1 decimal place)

I am wondering, since these columns rely on other calculated columns to produce their values, maybe that's the reason that the Flow doesn't capture them? Maybe there is a delay in calculations within the time the Flow kicks off? But the thing is, the SharePoint List reflects the correct values anyway, so I'm confused.

 

Can anyone offer assistance on this issue? Any opinions and suggestions are greatly appreciated! 

Thank you!

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Calculated Column value in SharePoint List displays wrong value when used in Compose action in Microsoft Flow

Hi @Y_R,

 

I have tested on my side that creates a column named caculate_number, its value = [Number1] + [Number2].

Annotation 2019-11-14 135638.png

 Then I get it from the Flow, it will display normally:

Annotation 2019-11-14 135849.png

 

Annotation 2019-11-14 135859.png

 

Annotation 2019-11-14 135907.png

 

Annotation 2019-11-14 135916.png

Could you please share how you set the calculate column?

Annotation 2019-11-14 140430.png

 

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

Highlighted
Helper II
Helper II

Re: Calculated Column value in SharePoint List displays wrong value when used in Compose action in Microsoft Flow

Hey @v-litu-msft ,

 

Sure. Below are the setting for the calculated columns that are returning the wrong value in the Flow Compose action (not the SharePoint List):

 

Capture.JPG

 

Capture2.JPG

 

Please note that in my initial explanation, I mentioned that I was having this issue when merging both Flows. The values return correctly when used in the Flow I have that is solely updating balances on approval. However, since separating these processes is proving to cause delays in updating balances, I have decided to merge them, since an employee's balance should be updated after successful approval anyway. No need to detach a follow-up step and place into a completely separate Flow. So my issue is during the process of merging into the approvals Flow.

 

Update

I have checked the contents of the trigger to the approval Flow which is "When an item is created" and realized that this is where the error occurs. It picks up the wrong value from the get go. Please see image below:

 

Capture3.JPG

 

Hence the reason the Compose actions are storing the wrong values. However, this discovery still does not solve anything, since it seems as though the Flow is being triggered before the calculated columns can do their thing. 

I have ruled out that timing seems to be key here, and maybe some sort of delay has to be put in place to allow the calculated columns in the row of the created item to produce the final values, then trigger the Flow?

This is a possible solution of what I thought of thus far. But is this possible?

 

All thoughts are welcomed. Thanks!

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (6,932)