cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate III
Advocate III

Update a Choice column in a Sharepoint List with a selected Dropdown option

 

Hi All,

 

I have a gallery which contains a Sharepoint list Data Source called 'Pages Test'.

I've inserted a Dropdown control that corresponds with a Choice column (called 'Status') in my Sharepoint list.


I want users to be able to select a Dropdown option in the App, and have that value patch to the Sharepoint List.

 

I can successfully patch a true/false column with a toggle switch in the App, and can patch text fields with no problem, but I can't get the choice field to work.

 

In the Dropdowns Item property I have:

Choices('Pages Test.Status)


In the Dropdowns OnSelect property I have: 

Patch('Pages Test', ThisItem, {Status: {Id: Dropdown1.Selected.Value, Value: Dropdown1.Selected.Value, '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"}})


I've also tried: 

Patch('Pages Test', ThisItem, {Status: {Id: Dropdown1.Selected.Value, Value: Dropdown1.Selected.Value}})


In both cases I'm receiving a Runtime Error: 'An error occurred on the server. Server Response: Not a valid connector error response.

 

Can anyone give me any pointers as to where I might be going wrong?

 

Cheers in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate III
Advocate III

Re: Update a Choice column in a Sharepoint List with a selected Dropdown option

Thanks Phoebe,

 

Your formula worked, cheers for that, however, for a dropdown I figured out the formula should be entered in the 'OnChange' property, not the 'OnSelect' property. Also, it was just missing one curly bracket, I've added it in:

Patch('Pages Test', ThisItem, {Status: {Value: Dropdown1.Selected.Value}})

 

Lastly, the Default property needs to be set to:

ThisItem.Status.Value

 Otherwise, in a gallery, the choice immediately snaps back to the first choice, while the corresponding SharePoint list is updated, resulting in discrepancies between the list and the app.

 

So for anyone who may read this in the future, the formulas are as follows (substitute red values for your own):

 

Default:

ThisItem.Status.Value

 

Items:

Choices('Pages Test'.Status)

 

OnChange:

Patch('Pages Test', ThisItem, {Status: {Value: Dropdown1.Selected.Value}})

 

OnSelect

This will remain blank, unless you have some other use for the property

 

Cheers,

 

Chris

 

 

 

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Update a Choice column in a Sharepoint List with a selected Dropdown option

Hi @cfebvre ,

Do you want to update a choice column of sharepoint list bu using a drop down?

If so, I suggest you:

1)set the drop down's Items:

Choices('Pages Test.Status)

2)set the drop down's OnSelect:

Patch('Pages Test', ThisItem, {Status: {Value: Dropdown1.Selected.Value})

 

 

Best regards,

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.
Highlighted
Advocate III
Advocate III

Re: Update a Choice column in a Sharepoint List with a selected Dropdown option

Thanks Phoebe,

 

Your formula worked, cheers for that, however, for a dropdown I figured out the formula should be entered in the 'OnChange' property, not the 'OnSelect' property. Also, it was just missing one curly bracket, I've added it in:

Patch('Pages Test', ThisItem, {Status: {Value: Dropdown1.Selected.Value}})

 

Lastly, the Default property needs to be set to:

ThisItem.Status.Value

 Otherwise, in a gallery, the choice immediately snaps back to the first choice, while the corresponding SharePoint list is updated, resulting in discrepancies between the list and the app.

 

So for anyone who may read this in the future, the formulas are as follows (substitute red values for your own):

 

Default:

ThisItem.Status.Value

 

Items:

Choices('Pages Test'.Status)

 

OnChange:

Patch('Pages Test', ThisItem, {Status: {Value: Dropdown1.Selected.Value}})

 

OnSelect

This will remain blank, unless you have some other use for the property

 

Cheers,

 

Chris

 

 

 

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (11,522)