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

How to update value to data source in backend

Hi,

 

I am struggling with updaing value to data source in backend which is when I submit a form.

I created a list form and connected to a Sharepoint list as data source, I want to update value to a field automatically in background when user clicking on submit button, tried many of ways but not work. can anyone give some iedas?

Can I use like DataCard.text = "abc" or something like that.

 

Regards

Steven

1 ACCEPTED SOLUTION

Accepted Solutions

Finally I found an approach,

1. Create one more field in Sharepoint list, like Status_internal, set "Revised" as default value.

2. Add the filed in Powerapps editform.

3. Set original filed.udpate = Status_internal.  like, Datacard1.update = Datacardvalue2.Selected.

then it will auto-update when user clicks the Submit button.

4. Hide the second Datacard.

 

Regards

Steven 

View solution in original post

4 REPLIES 4
Meneghino
Community Champion
Community Champion

I never use forms, try Patch() instead.

Some reference here:

https://baizini-it.com/blog/index.php/2017/09/28/powerapps-101-create-your-own-forms/

v-micsh-msft
Community Support
Community Support

Hi @StevenZhang,

 

Could you please explain a bit for the scenario of updating data?

Which record that you would like to update with, is it the one just submitted by the form control?

If yes, and you would like to modify the value of the newly submitted record, then you could take use of Patch to deal with that.

For example:

Patch(DataSource, EditForm.LastSubmit, {Field:Value})

For form control, the corresponding field is associated with the Form DataCard, and the value needed to update to the proper field is placed at the Update property of the DataCard.

You may take a look at the following article regarding how to deal with Card control and the form control:

Understand data forms in Microsoft PowerApps

Card control in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Michael,

 

please see picture below, the form connected to a Sharepoint list, I'd like to update "ReqStatus" to "Revised" from current one when user clicking on "Submit" button. tried to use Patch function but did not work.

I don't want user to modify ReqStatus manually.

powerapps field.jpg

 

Regards

Steven

Finally I found an approach,

1. Create one more field in Sharepoint list, like Status_internal, set "Revised" as default value.

2. Add the filed in Powerapps editform.

3. Set original filed.udpate = Status_internal.  like, Datacard1.update = Datacardvalue2.Selected.

then it will auto-update when user clicks the Submit button.

4. Hide the second Datacard.

 

Regards

Steven 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,521)