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

Patch formula for Sharepoint List Not Working

Hi,

I am trying to create a Patch formula that records the selections of divisions, categories, and sub-categories that were selected on previous screens and previous galleries. I want the formula set up so that when you click on the arrow icon of the sub-category of your choice, it records all your previous selections and puts it into a SharePoint list. I have taken pictures of my current formula along with the error I am recieving. I have also took a picture of the Sharepoint list that I will be using and the the columns associated with that list. Could this issue have to due with the type of columns I have in my SharePoint lists? And if so what types should I change them to?

 

Thank you,

Ryan

4 REPLIES 4
RezaDorrani
Dual Super User II
Dual Super User II

Hi @Ryan_LaCroix 

 

Looks like you are trying to patch complex type columns (choice, lookups etc)

 

Check this blog on syntax for setting values for complex types and accordingly apply it to your patch statement

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

v-yutliu-msft
Community Support
Community Support

Hi @Ryan_LaCroix ,

Could you tell me the data type of the fields that you want to update?

                             the control that you want to use to update data?

If you want to update a single choice column, I suggest you try this:
{columnname1.Value:dropdown.Selected.columnname2}

If you want to update a multiple choice column, I suggest you try this:
{columnname: combo box1.SelectedItems})

To sum up, what control and what data type will both effect the Patch formula.

Here's a doc about how to update complex field for your reference:

https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/

 

 

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.

Hi @v-yutliu-msft,

I am looking to update the division, category and subcategory in my sharepoint list. I thought of bringing in two dropdowns that are set up so when you get to the Subcategory screen, they are set on what you previously selected in prior screens. I just need a Patch formula that will record these dropdowns as well as the subcategory that the user selects when they click on the arrow icon. I believe that the dropdowns are just choice types in the Sharepoint list but I am not sure what the icon type is in the Sharepoint List. I posted a screenshot of my formula that I have created and it still gives me an error and does not upload the information to SharePoint. Any suggestions? 

Hey,

 

If you want to update dropdown I assume it is a choise field in Sharepoint. Therefore, if you want to patch value from a dropdown use this.

 

{Category: {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id:ID_of_Selected, Value:Value_Of_Selected}

 

Since you also need the ID_of_Selected, you have to hard code it as I have not found how to retrieve it, but basically in you sharepoint list field the Id is the order of your choices starting from zero, eg if your selected item is on the 3rd line of your choice column, the Id is 2. You could use if statement for this.

 

Hope this helps.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,583)