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

Save dropdown field value to SharePoint list

Hi,

 

I created dropdown filed on Powerapps form and i wanted to save the dropdown value to SharePoint List when a user submits the form.

 

After doing some research I found that I need to use Patch function, but someone please let me know the formula?

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Save dropdown field value to SharePoint list

Hi @Snacham 

 

Do you want to save Drop down selected value to SP list?

What is the column type in your SP list? Choice type or others?

I test with one choice type as next:

Data Source:

SaveDropDown.PNG

App test:

Patch method:

Button2.OnSelect=Patch('2019test',Defaults('2019test'), {
Title:DataCardValue5.Text,
ChoiceTypeSmiley Sad{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:DataCardValue8.Selected.Value})
}
)

 

SubmitForm Method:

icon3.OnSelect=SubmitForm(Form2)

SaveChoiceTypePatch.PNG

 

savedropdownvalue.gif

 

Then Check:

Check.PNG

 

If the coulmn type is one lookup column type,could you please reference this:

https://powerusers.microsoft.com/t5/General-Discussion/How-to-patch-a-SharePoint-Lookup-Column/td-p/...

 

If you want to Patch one ComboBox value, could you please reference  this:

https://powerusers.microsoft.com/t5/General-Discussion/Patch-Combobox-to-SharePoint-Choice-Coloum/m-...

 

Hope this could be helpful.

 

Best Regards.

Yumia

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Save dropdown field value to SharePoint list

Hi @Snacham 

 

If you are using an edit form, you can directly add a Data Card for the specific attribute and refer to the same control in the "Update" attribute of your data card. This will automatically save the value when the form is submitted.
If you have individual controls, then using a Patch function would be a better choice.
To create a New Record: 
Patch(SPListName,Defaults(SPListName),{Field1:"Value1",Field2:"Value2"})
-- Defaults is used to create a New record in the SP list.
To update an existing record: 
Patch(SPListName,Lookup(SPListName, Title = TextInput1.Text),{Field1:"Value1",Field2:"Value2"})
-- If you want to modify existing record, we need to use lookup/filter to get the specific record based on some condition that will be updated.
Here, SPListName is the name of my SharePoint list, please modify the formula according to your Data SOurce and its attributes.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Snacham
Level: Powered On

Re: Save dropdown field value to SharePoint list

Hi,

 

I need to submit the Powerapps form and save the dropdown data to the SP list. 

 

In short I want to do both Submit and Patch on one button.

 

Please let me know if you have questions.

Thanks

Community Support Team
Community Support Team

Re: Save dropdown field value to SharePoint list

Hi @Snacham 

 

Do you want to save Drop down selected value to SP list?

What is the column type in your SP list? Choice type or others?

I test with one choice type as next:

Data Source:

SaveDropDown.PNG

App test:

Patch method:

Button2.OnSelect=Patch('2019test',Defaults('2019test'), {
Title:DataCardValue5.Text,
ChoiceTypeSmiley Sad{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Value:DataCardValue8.Selected.Value})
}
)

 

SubmitForm Method:

icon3.OnSelect=SubmitForm(Form2)

SaveChoiceTypePatch.PNG

 

savedropdownvalue.gif

 

Then Check:

Check.PNG

 

If the coulmn type is one lookup column type,could you please reference this:

https://powerusers.microsoft.com/t5/General-Discussion/How-to-patch-a-SharePoint-Lookup-Column/td-p/...

 

If you want to Patch one ComboBox value, could you please reference  this:

https://powerusers.microsoft.com/t5/General-Discussion/Patch-Combobox-to-SharePoint-Choice-Coloum/m-...

 

Hope this could be helpful.

 

Best Regards.

Yumia

View solution in original post

Snacham
Level: Powered On

Re: Save dropdown field value to SharePoint list

ThankYou!! It worked for me.

Snacham
Level: Powered On

Re: Save dropdown field value to SharePoint list

Hi, 

Sorry for bothering you, but the solution you provided will that work for drop-down Column which has connected to datasource?

 

Or do I need to change anything in the formula?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 183 members 4,734 guests
Please welcome our newest community members: