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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / update(deduct based of...
Power Apps
Answered

update(deduct based of an existing datacard) a column in another list based of user name

(0) ShareShare
ReportReport
Posted on by 114

i have 2 sharepoint lists one is called Leave Requests and the other is Employees, i have an edit form that is connected to "Leave requests" and i want the form upon success to take a number from a datacard in the edit form and deduct that value from a column called "Vacation Days Count" in "Employees"(it has only 2 columns "Employee Name", "Vacation Days Count"), the row that it will deduct from, will be based of the username, here is what i got:

If(DataCardValue3.Selected.Value = "Approved",

Patch('Employees', 


LookUp(Employees, 


'Employee Name'.DisplayName = User().FullName,


{'Vacation Days Count': 20}
)));

how ever this formula instead of changing an existing record, it adds a new one without a name and a count of 20(i put a random number because i do not know who i can make it read the existing number and deduct form it)

Categories:
I have the same question (0)
  • Verified answer
    AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @GTurkistane 

     

    Please try this:

     

    If(DataCardValue3.Selected.Value = "Approved",
     Patch('Employees', 
     LookUp(Employees, 'Employee Name'.DisplayName = User().FullName),
     {
     'Vacation Days Count': 20
     }
     )
    );

     

     

    I have moved the closing bracket of the lookup function.

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • GTurkistane Profile Picture
    114 on at

    thank you it worked, do you know i can get the current count and then deduct from it?

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    @GTurkistane 

     

    Try this:

    If(DataCardValue3.Selected.Value = "Approved",
     Patch('Employees', 
     LookUp(Employees, 'Employee Name'.DisplayName = User().FullName),
     {
     'Vacation Days Count': 
     LookUp(Employees, 
     'Employee Name'.DisplayName = User().FullName).'Vacation Days Count' - Value(TextInput1.Text)
    // Where TextInput1 would be the amount of days a user would enter
     }
     )
    );
  • GTurkistane Profile Picture
    114 on at

    you are amazing, thank you so much it worked

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard