cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
v-choa
Microsoft
Microsoft

Patching DropDown from Canvas App to SharePoint Choices

I am trying to save Drop down values from Canvas app to Choices in SharePoint as given below:

Patch(table, defaults(table),{choiceField1:{value:somevalue}, {choiceField2:{somevalue}})

 

So I am saving 2 fields differently and it works. Instead both the fields should be saved the same way but it doesn't work if I save choiceField2 like choiceField1. 

 

Please advice why this discrepancy is there.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@v-choa 

Your formula should be like this:

Patch(table, 
    defaults(table),
    {
       choiceField1: {Value:"somevalue"}, 
       choiceField2:{Value:"somevalue"}
    }
)

To be truly compliant, it should be the following:

 

Patch(table, 
    defaults(table),
    {
       choiceField1: 
          {Value:"somevalue",  
           '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}, 
       choiceField2:
          {Value:"somevalue",  
           '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}
    }
)

NOTE: the above formulas assume your choice columns are single selection (not multi select checkbox types) and that the value you are submitting to them is a value that is defined in the choices for that column.

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@v-choa 

Your formula should be like this:

Patch(table, 
    defaults(table),
    {
       choiceField1: {Value:"somevalue"}, 
       choiceField2:{Value:"somevalue"}
    }
)

To be truly compliant, it should be the following:

 

Patch(table, 
    defaults(table),
    {
       choiceField1: 
          {Value:"somevalue",  
           '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}, 
       choiceField2:
          {Value:"somevalue",  
           '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}
    }
)

NOTE: the above formulas assume your choice columns are single selection (not multi select checkbox types) and that the value you are submitting to them is a value that is defined in the choices for that column.

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

I will try this. Thankyou

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (1,010)