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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Update Sharepoint list...
Power Automate
Unanswered

Update Sharepoint list - add instead of replace value of a column

(0) ShareShare
ReportReport
Posted on by 6

Hello,

 

I am building the Annual Leave Flow in my company and I have an important tasks that's failing. We have a Sharepoint list with Annual Leave Balance columns where I want to update the Spent 2021 field (this field takes place in calculating the total remaining balance of annual leave days) with the number of days that the employee had requested for. Problem is that right now it replaces the entire value of Spent 2021 with the Days but i want to add them to the existing value of Spent 2021 for that user.

 

sharepoint-list-addDays.png

 

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Dzongov-Sunwell,

     

    Just to validate, is that days column stored in the same list or a different one?

     

    Probably the quickest solution is to add a get item action before the update item to retrieve the spent 2021 balance.

     

    After that you can use that Spent2021 number in an expression with the add function and add the additional days in the update item action:

     

    add(outputs('Get_item')?['body/Spent2021'], items('Apply_to_each')?['Days'])

     

    getbalancefirst.png

  • Dzongov-Sunwell Profile Picture
    6 on at

    Hey @Expiscornovus ,

     

    Days is actually coming from the submitted MS Form that says how many days the employee wants to take. I then update a separate SP list which we will just use to keep track of leave requests. So basically i want to get the Spent 2021 column value from the Leave Balance list, (although i am not sure what to provide as an ID there, at this point this will be my first interaction with this Leave Balance list), then i want to do a foreach

     

    sharepoint-list-addDays-explanation.png

  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Dzongov-Sunwell,

     

    You can add expressions via the expression editor. This way it will recognize the add function as well.

     

    expression_viaexpressioneditor.png

     

    However, I don't think we can use this expression and the Get item action because you don't know the ID of the correct Annual Leave Balance list item yet.

     

    In order to find the correct annual leave balance list item we need to match it to the leave request. My guess is that in both lists you have a person type column called employee, correct? 

     

    If so, I can create another example for you with a different approach.

  • Dzongov-Sunwell Profile Picture
    6 on at

    Hey,

     

    Thanks for the quick resposne. You are right and i had to make my own logic in how to tie the ID in the Balance sheet so i did that and then i used this formula to make the addition. I have tried to do it that way before but since you asked me to try it out again from the dynamic input field - this time it worked.

     

    Let me paste the screenshot so others can see and hopefully benefit.

     

    sharepoint-list-addDays-solution.png

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard