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 / Updating Data in Share...
Power Apps
Answered

Updating Data in Sharepoint

(0) ShareShare
ReportReport
Posted on by 156

Goal:
- To update data taken from the DataCardValue in Powerapps inside a Sharepoint List by adding to the concurrent amount.

- Making sure that it is linked to the correct Leave Type and correct Name

Issue:

- I can create a new data but I can't update the current one the person is entitled to.

- I don't know how to make it link so that it captures the person's data correctly in order to update their specific record.

Concurrent Code in Use:

 

UpdateIf('EMP Leave Quota', DataCardValue15.Selected.Value= "Medical" , {Used:Value(DataCardValue24.Text)});

 

 

Old Testing Code (Would prefer to use this instead):

 

If(
 DataCardValue15.Selected.Value= "Medical",
 Patch(
 'EMP Leave Quota',
 {Used:Value(DataCardValue24.Text)}
 ),
 DataCardValue15.Selected.Value= "Maternity",
 Patch(
 'EMP Leave Quota',
 {Used:Value(DataCardValue24.Text)}
 ),
 Patch(
 'EMP Leave Quota',
 {Used:Value(DataCardValue24.Text)}
 )
);

 

The first one is to update where the 'Leave Type' is equivalent to Medical Leave
Second one is for Maternity, which will be deducted from Maternity Leave

Third one is for the 2 who does not fall under that category that will be deducted from Annual Leave type

Screenshot 2021-01-05 at 2.58.17 PM.jpg
Screenshot 2021-01-05 at 2.57.37 PM.jpg
Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @gimar01 ,

     

    So would you like to update the Used value to "EMP Leave Quota" list, depending on employee number/name and leave type?

     

    If so, as per your screenshots, assuming that Leave Type is a Choice type (EDIT: Allow Single Selection) column and Employee No is a Text type column, you could modify the testing code to:

     

    If(
     DataCardValue15.Selected.Value= "Medical",
     Patch(
     'EMP Leave Quota',
     LookUp(Filter('EMP Leave Quota','Leave Type'.Value = "Medical Leave"),'Employee No' = EmployeeNoDataCardValue.Text),
     {Used:Value(DataCardValue24.Text)}
     ),
     DataCardValue15.Selected.Value= "Maternity",
     Patch(
     'EMP Leave Quota',
     LookUp(Filter('EMP Leave Quota','Leave Type'.Value = "Maternity Leave"),'Employee No' = EmployeeNoDataCardValue.Text),
     {Used:Value(DataCardValue24.Text)}
     ),
     Patch(
     'EMP Leave Quota',
     LookUp(Filter('EMP Leave Quota','Leave Type'.Value = "Annual Leave"),'Employee No' = EmployeeNoDataCardValue.Text),
     {Used:Value(DataCardValue24.Text)}
     )
    );

     

     

    Please have a try, and if have any question you could leave it here.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

     

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard