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 / Take value of a sharep...
Power Automate
Unanswered

Take value of a sharepoint list and subtract a value in another sharepoint list

(0) ShareShare
ReportReport
Posted on by

Hi everyone, I have 2 Sharepoint lists, User list and Leaves Details list. In both lists, I have 2 similar columns Name and Number of Days. In the User list it is pre-populated with name and number of days items while in the Leaves Details list, it will be used in the PowerApps to create new records and every time a user creates a new record in the Leaves Details list, the Number of Days in User list should be subtracted from the value key-ed in the new item created in the Leaves Details list. I tried following this method provided by v-chenzi in this link however I do not get the result that I want. There are no errors in my flow but my flow didn't run properly. Attached are images of my flow for reference.

 

screnshot1.png

screnshot2.png

screnshot3.png

The Number of Days expression is

sub(items('Apply_to_each')?['NumberofDays'],triggerOutputs()?['body/Numberofdays'])
 
Leaves Details list structure:
screnshottest.png
User list structure:
123.png
Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Anonymous 

     

    what is issue with output? is it the decimal number 10.0 format is causing issue ?

     

  • Community Power Platform Member Profile Picture
    on at

    Oh sorry I forgot to mention that I put my initial Number of Days in the User list as 10.0 and when someone creates a new record in the Leaves Details list as shown in the image which is 1, the user K's Number of Days in the User list should be subtracted and now turns to 9.0

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Anonymous 

     

    Try this expression for updating Number of days 

     

    Nived_Nambiar_0-1683866447136.png

     

    float(sub(int(items('Apply_to_each')?['NumberofDays']),int(triggerOutputs()?['body/NumberofDays'])))
     
     
    Hope this helps !
     
    Mark it as solution if it resolves your query !
     
  • Community Power Platform Member Profile Picture
    on at

    The flow is still not triggered 😞

  • Community Power Platform Member Profile Picture
    on at

    After testing again, I found that my flow is failed due to my Filter Query. However, I didn't delete any of Name columns in the lists.

     

    Screenshot 2023-05-12 171333.png

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Anonymous 

     

    could u share how u have written filter query ?

     

     

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