cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kpreeti1256
Level: Powered On

Patch details of an edit form

Hi community members,

I am trying to patch the details entered in an edit form along with some controls value outside the form. I cannot use submit form for outside controls. After looking through various solutions and articles, i got to know that this will be solved through Patch function.

Can anyone help me writing the formula? I have an edit form with columns: EmployeeName, EmployeeNumber etc. a total of 7 attributes and i am doing some calculation on outside control based on values entered in edit form. Please help me to complete my formula. Thanks in advance.
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Patch details of an edit form

Hi @Kpreeti1256 

 

You can try out the below expression:
 
Incase you want to edit already exisiting entry:
Patch(DataSourceName, Lookup(DataSource,EmployeeName= DataCardValue1.Text),{EmployeeNumber: DataCardValue2.Text,EmployeeMobileSmiley Very HappyataCardValue3.Text,CalculatedColumn = Label12.Text})
 
If you want to create a new record:
Patch(DataSourceName,Defaults(DataSource),{EmployeeName= DataCardValue1.Text,EmployeeNumber: DataCardValue2.Text,EmployeeMobileSmiley Very HappyataCardValue3.Text,CalculatedColumn = Label12.Text})
 
Please replace DataSourceName and all the attributes in the formula as per your actual controls/arguments name. You can add as many attributes between the crly brackets separated by a comma.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
2 REPLIES 2
Super User
Super User

Re: Patch details of an edit form

Hi @Kpreeti1256 

 

You can try out the below expression:
 
Incase you want to edit already exisiting entry:
Patch(DataSourceName, Lookup(DataSource,EmployeeName= DataCardValue1.Text),{EmployeeNumber: DataCardValue2.Text,EmployeeMobileSmiley Very HappyataCardValue3.Text,CalculatedColumn = Label12.Text})
 
If you want to create a new record:
Patch(DataSourceName,Defaults(DataSource),{EmployeeName= DataCardValue1.Text,EmployeeNumber: DataCardValue2.Text,EmployeeMobileSmiley Very HappyataCardValue3.Text,CalculatedColumn = Label12.Text})
 
Please replace DataSourceName and all the attributes in the formula as per your actual controls/arguments name. You can add as many attributes between the crly brackets separated by a comma.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Community Support Team
Community Support Team

Re: Patch details of an edit form

Hi @Kpreeti1256 ,

Could you describe more clearly about the calculation on outside control based on values entered in edit form?

Waht's more, what value do you want to use, the data in textinput, the data that you select in drop down, etc?

If the form has not been submitted, you could use the value entered in the form by using:

Value(DataCardValue1.Text)           (textinput)

Value(DataCardValue1.Selected.fieldname)       (drop down)

DataCardValue1 is the control name.

If the form has been submitted and you want to use the value entered in the form.

Data will be invalid after the form being submitted.

So you need to save the data as variable before the form being submitted.

Try this formula:

Set(a,Value(DataCardValue1.Text));SubmitForm(Form1)

Then, you could use the variable a directly.

 

 

Best regards,

Community Support Team _ Phoebe Liu

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

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 184 members 4,508 guests
Please welcome our newest community members: