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
Dual Super User
Dual 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,EmployeeMobile:DataCardValue3.Text,CalculatedColumn = Label12.Text})
 
If you want to create a new record:
Patch(DataSourceName,Defaults(DataSource),{EmployeeName= DataCardValue1.Text,EmployeeNumber: DataCardValue2.Text,EmployeeMobile:DataCardValue3.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!

View solution in original post

2 REPLIES 2
Dual Super User
Dual 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,EmployeeMobile:DataCardValue3.Text,CalculatedColumn = Label12.Text})
 
If you want to create a new record:
Patch(DataSourceName,Defaults(DataSource),{EmployeeName= DataCardValue1.Text,EmployeeNumber: DataCardValue2.Text,EmployeeMobile:DataCardValue3.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!

View solution in original post

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

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

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

Top Kudoed Authors
Users Online
Currently online: 267 members 5,307 guests
Please welcome our newest community members: