cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

update SharePoint list item in edit form

I am trying to update a sharepoint list item, for an approval process it works fine on one of my other forms but for some reason it is not working on this one. 

 

I have a status field that is set to "Pending" by default on submission of the form, on the approval form i have two buttons "Approve" and "Decline" 

On the AppStart i have 

 

Set(varID,Value(Param("ATA")));If(varEmpID <> 0, Set(varRecord, LookUp('ATA_Reord', ID = varID));Navigate(ApprovalForm) )

 

 When a form is submitted an email is sent to HR with a link and it takes them to the corrected record, this works. 

 

They then need to approve or decline, and an email is sent and this is all working fine the email is sent and has all the information in it. 

 

But the sharepoint record is not updating, On another form i have this 

 

 

UpdateIf(
   'Employee Absence Request (App)', ID = varEmpID, {'Sign-offStatus':"Approved"})

 

When i try and use this same logic on my new form it doesn't update the status in my SharePoint list

 

UpdateIf(
   'ATA_Reord'', ID = varID, {'Status':"Approved"})

 

 

the approval form is an edit form with a few extra fields, "HR comments" "Yes or no" all text fields. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: update SharePoint list item in edit form

Hi @amyharkus86 ,

Your issue is that varID matches the ID of 'Employee Absence Request (App)' - not the ID of 'ATA_Reord', so there will be no record to update. Your also have an extra ' in the code you posted

UpdateIf(
   'ATA_Reord'', 
   ID = varID, 
   {'Status':"Approved"}
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: update SharePoint list item in edit form

Hi @amyharkus86 ,

Your issue is that varID matches the ID of 'Employee Absence Request (App)' - not the ID of 'ATA_Reord', so there will be no record to update. Your also have an extra ' in the code you posted

UpdateIf(
   'ATA_Reord'', 
   ID = varID, 
   {'Status':"Approved"}
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted
Resolver I
Resolver I

Re: update SharePoint list item in edit form

The ATA form has an ID field as well and is the only database connection on the app. 

 

How would i update the sharepoint list? 

 

 

Highlighted
Resolver I
Resolver I

Re: update SharePoint list item in edit form

@WarrenBelz thanks again, I changed it an have done this 

UpdateContext({Pending:"Approved"});SubmitForm(Form2_1)

this is updating the current record in sharepoint and not creating a new one, at the push of the button it changes the status field to pending, same for decline but "Declined" in the update context. 

 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,815)