web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Flow to update calculated column in SPO

(0) ShareShare
ReportReport
Posted on by 6

Hello,

I have a SPO list with a calculated column with this formula =DATEDIF([Start Date],TODAY(),"D") to give me number of days employed. I have a separate scheduled flow that sends out an email to anyone on the list who has been employed for 90, 180, and 270 days. I realized after I created that flow that the SPO calculated column doesn't update unless it's done manually. Is there a scheduled flow that I can create to update this calculated column daily? Thanks in advance. 

I have the same question (0)
  • Verified answer
    rzaneti Profile Picture
    4,159 Super User 2025 Season 2 on at
    Re: Flow to update calculated column in SPO

    Hi @laurenp ,

     

    I'm not very familiar with SP List expressions, but apparently there is a way to create a calculated field to capture this day difference. 

     

    In any case, I will share with you a Power Automate solution for that. You just need to create a recurrent flow to run in a daily basis and contains the following actions:

     

    List overview

    For this example, I will be using this SP List, which basically track the days since a task was created (the logic is the same for your use case):

    rzaneti_0-1685804521221.png

     

     

    Step 1: Get items from list

    Pull all records from your list (you can apply any filters if you need it). You can do it by using the action 'Get items'.

    rzaneti_1-1685804646745.png

     

     

    Step 2: Timespan variable

    The dateDifference expression in Power Automate returns a timespan, which has a string datatype. We will need to store it in a variable and process it before update the SP List.

    rzaneti_2-1685804659739.png

     

    Step 3: Loop records and capture timespan

    Then you will need to loop all of the records from your 'Get items' action and store the dateDifference in timespan variable. For doing this, you will use this expression: dateDifference(items('Apply_to_each')?['Starttime'], utcNow()). Make sure to change the bolded text to your actual "start date" column name. 

    rzaneti_3-1685804773428.png

     

    The output from dateDifference will be something similar to it. The amount before the first '.' (29) is the quantity of days between the 2 dates:

    rzaneti_4-1685804894168.png

     

    Step 4 (final): Update the list

    Finally, you call the 'Update item' action inside the loop to update your List record. Make sure to pass all again all the field values as input (ID to ID, Title to Title, and so on): if you ignore it, the fields will be overwritten with blanks.

     

    For your "date difference" column, you will use this expression: Int(first(split(variables('timespan'), '.'))). We are basically splitting the timespan by the '.', catching the first part of it text (the qty of days) and converting to an integer (I'm assuming here that your list column contains a numeric data type).  

    rzaneti_5-1685805071727.png

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

  • laurenp Profile Picture
    6 on at
    Re: Flow to update calculated column in SPO

    That seems to have worked! I'll test it overnight to see if it updates the calculated column by tomorrow morning. Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard