cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Nikhil2
Level 8

Patch function error

Hello Team,

 

Here i am using the collect, forall and patch functions to collect and save data to sharepoint list. Is this possible to use collect and forall and patch function in one button command and save data to sharepoint?

 

Could anyone help on this would be appreciated ?

 

Collect(IT,{Title:TextInput1.Text,ContactPerson:SearchTerm.Text,CreationDate:DatePicker1.SelectedDate,Description:TextInput3.Text,Justification:TextInput4.Text,DesiredDate:DatePicker2.SelectedDate,Process:Dropdown2.Selected.Value});UpdateContext({Submit:true});If(!IsBlank(TextInput1.Text),true,UpdateContext({Submit:false})) this i am using in submit button

 

ForAll(IT,Patch('Business Requirements List',Defaults('Business Requirements List'),{Title1: Description ,Title: Title,Justification_x0020_of_x0020_req: Justification,Desired_x0020_date:DesiredDate,Created:CreationDate,Process_x0020__x0028_Vorstand_x0:Process,Contact_x0020_Person_x0020_in_x0:ContactPerson})) this i am using on Save button. this is where the error appears.

 

Thanks and Regards,

Nikhil.

3 ACCEPTED SOLUTIONS

Accepted Solutions
mr-dang
Level 10

Re: Patch function error


@Nikhil2 wrote:

 

Collect(IT,{Title:TextInput1.Text,ContactPerson:SearchTerm.Text,CreationDate:DatePicker1.SelectedDate,Description:TextInput3.Text,Justification:TextInput4.Text,DesiredDate:DatePicker2.SelectedDate,Process:Dropdown2.Selected.Value});UpdateContext({Submit:true});If(!IsBlank(TextInput1.Text),true,UpdateContext({Submit:false})) this i am using in submit button


Hi @Nikhil2,

Can you look at the part in red? The condition is built in a strange way.

 


@Nikhil2 wrote:

ForAll(IT,Patch('Business Requirements List',Defaults('Business Requirements List'),{Title1: Description ,Title: Title,Justification_x0020_of_x0020_req: Justification,Desired_x0020_date:DesiredDate,Created:CreationDate,Process_x0020__x0028_Vorstand_x0:Process,Contact_x0020_Person_x0020_in_x0:ContactPerson})) this i am using on Save button. this is where the error appears.


Can you share more about what kind of error is occuring?

 

Mr. Dang

Microsoft Employee
@8bitclassroom

View solution in original post

Community Support Team
Community Support Team

Re: Patch function error

Hi @Nikhil2,

 

Could you please share a bit more about the error message that you mentioned within your app?

Could you please share a bit more about your SP list?

Further, could you please share a screenshot of your app's configuration?

 

Please check if you have provided proper column names (column names of your SP list) within the ChangeRecord(s) part of the Patch function.

 

In addition, please check if you have faced disambiguation issue within the Patch function that you provided. If you have faced disambiguation issue within your formula, you could consider take a try to fix your issue using disambiguation operator (@).

 

More details about the disambiguation operator (@), please check the following article:

Disambiguation operator

 

Please also take a try to modify your Patch function formula as below:

ForAll(
RenameColumns(RenameColumns(RenameColumns(RenameColumns(RenameColumns(RenameColumns(RenameColumns(IT,"Title","Title2"),"ContactPerson","ContactPerson2"),"CreationDate","CreationDate2"),"Description","Description2"),"Justification","Justification2"),"DesiredDate","DesiredDate2"),"Process","Process2"),
Patch('Business Requirements List',
Defaults('Business Requirements List'),
{Title1:Description2,Title:Title2,Justification_x0020_of_x0020_req:Justification2,Desired_x0020_date:DesiredDate2,Created:CreationDate2,Process_x0020__x0028_Vorstand_x0:Process2,Contact_x0020_Person_x0020_in_x0:ContactPerson2}
)
)

Then check if your issue is solved.

 

 

Best regards,

Kris

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

View solution in original post

Nikhil2
Level 8

Re: Patch function error

Hello mr.Dang,

 

Thank you for the reply, what i am doing is i have two different buttons which is submit(where i collects the data and store to collections) and other save button(where i have used forall and patch function). Perhaps what i need is possibility to store the information using only one button which is save.

 

I want to collect the data and save the information to sharepoint list using Save button only not submit and click again save.

 

Thanks and Regards,

Nikhil Prakash Muthya.

View solution in original post

4 REPLIES 4
mr-dang
Level 10

Re: Patch function error


@Nikhil2 wrote:

 

Collect(IT,{Title:TextInput1.Text,ContactPerson:SearchTerm.Text,CreationDate:DatePicker1.SelectedDate,Description:TextInput3.Text,Justification:TextInput4.Text,DesiredDate:DatePicker2.SelectedDate,Process:Dropdown2.Selected.Value});UpdateContext({Submit:true});If(!IsBlank(TextInput1.Text),true,UpdateContext({Submit:false})) this i am using in submit button


Hi @Nikhil2,

Can you look at the part in red? The condition is built in a strange way.

 


@Nikhil2 wrote:

ForAll(IT,Patch('Business Requirements List',Defaults('Business Requirements List'),{Title1: Description ,Title: Title,Justification_x0020_of_x0020_req: Justification,Desired_x0020_date:DesiredDate,Created:CreationDate,Process_x0020__x0028_Vorstand_x0:Process,Contact_x0020_Person_x0020_in_x0:ContactPerson})) this i am using on Save button. this is where the error appears.


Can you share more about what kind of error is occuring?

 

Mr. Dang

Microsoft Employee
@8bitclassroom

View solution in original post

Community Support Team
Community Support Team

Re: Patch function error

Hi @Nikhil2,

 

Could you please share a bit more about the error message that you mentioned within your app?

Could you please share a bit more about your SP list?

Further, could you please share a screenshot of your app's configuration?

 

Please check if you have provided proper column names (column names of your SP list) within the ChangeRecord(s) part of the Patch function.

 

In addition, please check if you have faced disambiguation issue within the Patch function that you provided. If you have faced disambiguation issue within your formula, you could consider take a try to fix your issue using disambiguation operator (@).

 

More details about the disambiguation operator (@), please check the following article:

Disambiguation operator

 

Please also take a try to modify your Patch function formula as below:

ForAll(
RenameColumns(RenameColumns(RenameColumns(RenameColumns(RenameColumns(RenameColumns(RenameColumns(IT,"Title","Title2"),"ContactPerson","ContactPerson2"),"CreationDate","CreationDate2"),"Description","Description2"),"Justification","Justification2"),"DesiredDate","DesiredDate2"),"Process","Process2"),
Patch('Business Requirements List',
Defaults('Business Requirements List'),
{Title1:Description2,Title:Title2,Justification_x0020_of_x0020_req:Justification2,Desired_x0020_date:DesiredDate2,Created:CreationDate2,Process_x0020__x0028_Vorstand_x0:Process2,Contact_x0020_Person_x0020_in_x0:ContactPerson2}
)
)

Then check if your issue is solved.

 

 

Best regards,

Kris

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

View solution in original post

Nikhil2
Level 8

Re: Patch function error

Hello mr.Dang,

 

Thank you for the reply, what i am doing is i have two different buttons which is submit(where i collects the data and store to collections) and other save button(where i have used forall and patch function). Perhaps what i need is possibility to store the information using only one button which is save.

 

I want to collect the data and save the information to sharepoint list using Save button only not submit and click again save.

 

Thanks and Regards,

Nikhil Prakash Muthya.

View solution in original post

Nikhil2
Level 8

Re: Patch function error

Hello,

 

Greetings for the day!

 

Well i have considered both the inputs and it worked as i was expected to.

 

Thanks for the input in quick time.

 

Thanks and Regards,

Nikhil Prakash Muthya.

Helpful resources

Announcements
thirdimage

Power Platform 24

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,468)