cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kzaidi
Helper I
Helper I

Updating Mutiple Columns with Patch

Hi all, I need to update two columns of my Sharepoint list based on the data in Sharepoint form. The form submits and updates all the columns which are mapped to the form except two column which gets data from comboboxes. Could you please check my statement below, not sure whats wrong here

 

Patch('SharePontListName', EditAllNewListForm.LastSubmit, {'Allocated Person': Combobox1.Selected.'User Name'}, {'Allocated to': varUserSelected});

 

The underlined ones are the sharepoint list columns I want to update . I am writing this statement in the "OnSuccess" property of "EditAllNewListForm" so that once the form updates all the items successfully, these two columns are updated at the end/

 

Any other workaround to achieve this?

 

TIA

 

4 REPLIES 4
BlessedCobba
Responsive Resident
Responsive Resident

@kzaidi 

A few things

Code should look more like this. you only need 1 set of { } with a comma separating each thing you want to add to a single row

Patch('SharePontListName', 
EditAllNewListForm.LastSubmit, 
   {
    'Allocated Person': Combobox1.Selected.'User Name', 
     'Allocated to': varUserSelected
   }
);

 
other thing with sharepoint as a data source, sometimes 'column name' doesnt work in patch and you need to change it to column_x0200_name

let me know how you go

kzaidi
Helper I
Helper I

Thank @BlessedCobba ,

I tried this one too but it says that function Patch has some invalid arguments, Its so annoying cos apparently everything looks okay

BlessedCobba
Responsive Resident
Responsive Resident

is there a red underline under anything specific?

can you paste in a screenshot?

v-qiaqi-msft
Community Support
Community Support

Hi@kzaidi,

Based on the issue that you mentioned, do you want to patch Combo Box selected to 'Allocated Person' and 'Allocated to'?

Could you please tell:

1). what the column type of these two columns, are they Choice or Person?

2). how you set the Items property of the Combo Box and how you create the varUserSelected?

Please do answer the above question.

If the 'Allocated Person' is a Choice type, I think you should use a formula as below to replace "Combobox1.Selected.'User Name'":

{'Allocated Person': {Value: ComboBox1.Selected.'User Name'}}

Regards,

Qi

Best Regards,
Qi

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,403)