web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Save Value of a Dropdo...
Power Apps
Answered

Save Value of a Dropdown from a Gallery to a sharepoint list

(0) ShareShare
ReportReport
Posted on by 12

Hello and greetings from Germany,

 

i use a dropdown field in a gallery and i am not able to save the different selected options in a sharepoint list. If i click on "Speichern" the list is only updated by the selection in the first item of the gallery. See the screenshots for more information. Here is the code from the OnSelect-Funktion of the Button "Speichern".

 

ForAll(colScannedItems;
Patch('DaSi-K-DPI';{
Titel:ThisRecord.ScannedItem;
Datum:ThisRecord.ScannedTime;
Bearbeiter:User().FullName;
Ort:Dropdown1.SelectedText.Value
}))

 

01.png02.png

 

Where is the knot in my head?

Categories:
  • gcmfaizan Profile Picture
    1,022 on at

    Hi @svenwbusch ,

     

    Your patch function seems to look fine, but I think the only mistake is you are not updating the column value of the collection upon on value change of the dropdown. Can you write this formula OnChange Property of your Dropdown in Gallery:

     

    Patch(colScannedItems, ThisItem, Ort: Dropdown1.SelectedText.Value)

     

    note: I assumed Ort is also a column in your colScannedItems.

    once you are done with the selection of dropdowns for all rows, then OnSelect property of Button "Speichern" use this formula:

    ForAll(
     colScannedItems,
     Patch(
     'DaSi-K-DPI',
     Defaults('DaSi-K-DPI'),
     {
    Title: ThisRecord.ScannedItem,
     Datum: ThisRecord.ScannedTime,
     Bearbeiter: User().FullName,
     Ort: ThisRecord.Ort
     }
     )
    )

     

    This will create new records in your SharePoint as per selected values.

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

     

    Thanks!

  • svenwbusch Profile Picture
    12 on at

    Thank you so far, @gcmfaizan but i get an error if i use the code in the onselect function. It says, the The data source is invalid.

     

    And you are right, Ort is a column in colScannedItems 🙂

     

    03.png

  • Verified answer
    gcmfaizan Profile Picture
    1,022 on at

    Hi @svenwbusch ,

     

    Firstly I apologize I made a mistake in the above formula to add {}. Here is the correct formula:

    Patch(colScannedItems, ThisItem, {Ort: Dropdown1.SelectedText.Value})


    BTW alternately we can also use this Patch function OnChange property of Dropdown:

     

    Patch( colScannedItems, LookUp(colScannedItems, YourUniqueColumn = ThisItem.YourUniqueColumn), { Ort: Dropdown1.SelectedText.Value } )

     

     

    Please have a look at Patch Function in Power Apps to get a better understanding of using patch function while you use it to create or update a record in data source or collection. 

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

     

    Thanks,

  • svenwbusch Profile Picture
    12 on at

    Hey @gcmfaizan ,

     

    you dont have to apologize, i am glad that someone helps me 😃

    Thank you for your help! You are awesome!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard