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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dropdown Patch Error
Power Apps
Answered

Dropdown Patch Error

(0) ShareShare
ReportReport
Posted on by 240

Hello All,

 

I have an error when trying to patch a change based on a dropdown in my gallery (nested gallery).

 

I've clearly done something wrong but really struggling to figure out what, any help is very appreciated.

 

OnChange

Patch(tbl_Eng,Gallery1_1.Selected,{'Colleague Category':Dropdown1})

 

Thanks

Chris

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,535 Super User 2026 Season 1 on at

    Hi @Appy1 ,

     

    The issue is that you are trying to patch the control to the datasource instead of the selected item within the DropDown. Please try the below:

     

    Patch(tbl_Eng,Gallery1_1.Selected,{'Colleague Category':Dropdown1.Selected})

     

    If this is not working, please share the Items property of the DropDown and the type of the column you are trying to patch.

  • CC-19121430-0 Profile Picture
    240 on at

    Hi @BCBuizer 

     

    Thanks for your reply, unfortunately it isn't working.

     

    I think you are right its due to my Items property, which is currently:

     

    ["","Engineer","Technician", "Net Zero"]

     

    I would need these as the options for the user to select but have also been struggling to get this right.

     

    Thank you!

    Chris

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Appy1 ,

     

    This is kinda tricky but let's try...

    Assuming Gallery 1 is your 1st Gallery and Gallery1_1 is your nested gallery

     

    What you need to do is, Patch your 2nd Gallery (Gallery1_1) in such a way that it is linked to the record of 1st Gallery

     

    To have better control of the records when saving:

    Use collection

     

    When you make changes in the data in 2nd Gallery (Gallery1_1), capture edited data in collection

    If(
     ThisItem.'Primary Key of 1st Gallery's datasource' in ColCaptureDetails.UniqueID_2ndGallery,
     Update(
     ColCaptureDetails,
     LookUp(
     ColCaptureDetails,
     UniqueID_2ndGallery = ThisItem.'Primary Key of 1st Gallery's datasource'
     ),
     {
     UniqueID_2ndGallery: ThisItem.'Primary Key of 1st Gallery's datasource',
     Record_1stGalleryLookUp: Gallery1.Selected,
     //...other fields from Gallery1_1
     }
     ),
     Collect(
     ColCaptureDetails,
     {
     UniqueID_2ndGallery: ThisItem.'Primary Key of 1st Gallery's datasource',
     Record_1stGalleryLookUp: Gallery1.Selected,
     //...other fields from Gallery1_1
     }
     )
     )

     

    So here's your collection

     

    When you are patching Records -> Make sure you patch the following:

    ForAll(
     ColCaptureDetails,
     With(
     {
     CurrentRecord_2ndGallery: ThisRecord
     },
     Patch(
     (datasource_of_2ndGallery),
     LookUp(datasource_of_2ndGallery, UniqueID_2ndGallery = CurrentRecord_2ndGallery.UniqueID_2ndGallery, ThisRecord),
     {
     LookUp_1stGallery: CurrentRecord_2ndGallery.Record_1stGalleryLookUp,
     UniqueID: CurrentRecord_2ndGallery.UniqueID_2ndGallery,
     //..... all fields
     }
     )
     )
    )

     

     

    I hope this works and helps you

  • CC-19121430-0 Profile Picture
    240 on at

    Hi @Ethan_R 

     

    Sorry, when i said nested i mean that the the screen is sat outside of the gallery itself so basically a popup that directs you to a different screen. The only gallery is named Gallery1_1. 

     

    Would this change what you have kindly suggested for me to try?

     

    Many thanks

    Chris

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Ohh @Appy1 ,

     

    Can you share the image of 1st and 2nd gallery to understand better?

    As I want to understand what items are you patching and where it resides in your App.

     

  • CC-19121430-0 Profile Picture
    240 on at

    Hi @Ethan_R 

     

    Thanks, so this is my gallery:

     

    Appy1_0-1683802814007.png

     

    onSelect of the info button, it takes you to this popup.

     

    Appy1_2-1683803125654.png

     

    Many thanks

    Chris

  • Verified answer
    BCBuizer Profile Picture
    22,535 Super User 2026 Season 1 on at

    Hi @Appy1 ,

     

    What is the type of the 'Colleague Category' column in tbl_Eng list? 

     

    For a Text type, the OnChange property of the dropdown should be:

    Patch(tbl_Eng,Gallery1_1.Selected,{'Colleague Category':Dropdown1.Selected.Value})

     

    For a Choice type, it should be:

    Patch(tbl_Eng,Gallery1_1.Selected,{'Colleague Category':{Value:Dropdown1.Selected.Value}})
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Appy1 ,

     

    Considering your 'Colleague Category' is optionset then your values as per @BCBuizer  should work.

    But as stated it doesn't assuming if this a 'Single Line of Text' and the Dropdown is your custom control to simply serve as Text Field?

     

    If so,

    //If Text Field then
    Patch(tbl_Eng,Gallery1_1.Selected,{'Colleague Category': Text(Dropdown1.Selected.Value) })
    
    //IF not Text field, then
    Patch(tbl_Eng,Gallery1_1.Selected,{'Colleague Category': Dropdown1.Selected.Value })

     

    Make sure you are saving correct data into correct datatype field

     

    I hope this helps

  • Sanshubh Profile Picture
    512 on at

    Hii @Appy1 
    Do you have multiple data in Gallery which you are patching?

    And you can use form Instead of gallery to make it more simple.

    Thanks,
    Sanshubh

  • CC-19121430-0 Profile Picture
    240 on at

    Thank you! @BCBuizer @Ethan_R 

     

    This worked very much appreciated!!!!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 301 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 297 Most Valuable Professional

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard