Hi,
I Have a farm with some fields ,I need to update the records with patch function,
i have tried so many formulas can any one help on this .
Thanks ,
Solved! Go to Solution.
Hi @Anonymous ,
Do you want to use the Patch function to update the Edit form data?
Does the Edit form bind to selected item in your Gallery properly?
Firstly, please make sure the Item property of the Edit form has been bind to proper record/item in your Gallery already. Set the Item property of the Edit form (EditForm1) to following:
Gallery1.Selected
Then you need to modify your Patch formula as below:
Patch(
'[MadCap_DWH].[USER_ACCESS_INFO]',
Gallery1.Selected,
EditForm1.Updates
)
or
Patch(
'[MadCap_DWH].[USER_ACCESS_INFO]',
LookUp('[MadCap_DWH].[USER_ACCESS_INFO]', PrimaryKeyColumn = Gallery1.Selected.PrimaryKeyColumn),
EditForm1.Updates
)
Note: The EditForm1 represents the Edit form in your canvas app.
Please consider take a try with above solution, check if the issue is solved.
Best regards,
Hi @Anonymous ,
As you are using a form you could simply SubmitForm()
Alternatively if you are looking to Patch() the syntax is as follows:
//For a new row
Patch(datasource, default(datasource), {item: "content"})
//Updating an existing row
Patch(datasource, gallery1.selected, {item: "content"})
Patch Example: https://www.youtube.com/watch?v=yS6mTRlmuls
Microsoft Docs: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch
Hope this helps!
Regards,
Benjamin Western | Automation Specialist
NextStep Creations
Taking your PowerApps Skill the NextStep
Hi,
Patch('[MadCap_DWH].[USER_ACCESS_INFO]',Gallery1.Selected,{emailID:DataCardValue4.Text,isActive:DataCardValue7.Text
,roleName:ComboBox2.SelectedItems.roleName,zone:ComboBox3.SelectedItems.Result,
market:ComboBox5.SelectedItems.Result,plant:ComboBox6.SelectedItems.Result})
As you suggested I have used this formula, but it's not working can you help on this .
Hi @Anonymous ,
Your Syntax looks correct.
However gallery1.selected (is this correct for your environment?)
gallery1.selected should represent the source of the single record that you are trying to patch to the datasource.
if your gallery is called testGallery then it would be testGallery.selected
Hope this helps!
Regards,
Hi @Anonymous ,
Do you want to use the Patch function to update the Edit form data?
Does the Edit form bind to selected item in your Gallery properly?
Firstly, please make sure the Item property of the Edit form has been bind to proper record/item in your Gallery already. Set the Item property of the Edit form (EditForm1) to following:
Gallery1.Selected
Then you need to modify your Patch formula as below:
Patch(
'[MadCap_DWH].[USER_ACCESS_INFO]',
Gallery1.Selected,
EditForm1.Updates
)
or
Patch(
'[MadCap_DWH].[USER_ACCESS_INFO]',
LookUp('[MadCap_DWH].[USER_ACCESS_INFO]', PrimaryKeyColumn = Gallery1.Selected.PrimaryKeyColumn),
EditForm1.Updates
)
Note: The EditForm1 represents the Edit form in your canvas app.
Please consider take a try with above solution, check if the issue is solved.
Best regards,
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
169 | |
94 | |
65 | |
64 | |
61 |
User | Count |
---|---|
223 | |
160 | |
93 | |
82 | |
80 |