cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ryan_LaCroix
Level: Powered On

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
Dual Super User
Dual Super User

Re: Patch formula for Sharepoint List Not Working

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

 

 

Community Support Team
Community Support Team

Re: Patch formula for Sharepoint List Not Working

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.
Ryan_LaCroix
Level: Powered On

Re: Patch formula for Sharepoint List Not Working

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? 

lucia
Level 8

Re: Patch formula for Sharepoint List Not Working

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,211)