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 / Patch using dropdown
Power Apps
Answered

Patch using dropdown

(0) ShareShare
ReportReport
Posted on by 278

Canvas App

Individual Labels & Text Inputs (No gallery or table)

 

 

This works, and is how individual Labels have text populated throughout the app:

 

LABEL DATA - Text =

LookUp ('Database Output 2',

DB_ID ='House DropDown_40'.Selected.DB_ID,

Jan_x0020_Elec_Provider)

 

 

My save button will not work though 😒

 

LABEL ACTION - OnSelect =

Patch('Database Output 2',

DB_ID='House DropDown_40'.Selected.DB_ID,

{Jan_x0020_Elec_Provider:'IP Elec Provider UD_1'.Text})

 

Error: Name isn't valid. This identifier isn't recognized.

 

 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Humanity 

    Your problem is that you are not providing a Record to Patch. 

    Patch requires (for updating a datasource), 3 parameters, the datasource, the source record and the change.

    You would be better off using the UpdateIf for this operation:

    UpdateIf('Database Output 2',
     DB_ID='House DropDown_40'.Selected.DB_ID,
     {Jan_x0020_Elec_Provider:'IP Elec Provider UD_1'.Text}
    )

    I hope this is helpful for you.

  • Verified answer
    WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    Hi @Humanity Firstly try this to correct the syntax

    Patch(
     'Database Output 2',
     {DB_ID:'House DropDown_40'.Selected.DB_ID},
     {Jan_x0020_Elec_Provider:'IP Elec Provider UD_1'.Text}
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Humanity Profile Picture
    278 on at

    Hooray!!!

     

    Thank you so much!

    Thank you both... I now know about UpdateIf 

     

    This has to be the coolest app ever!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @WarrenBelz 

    I believe you might have an extra comma in your formula.  

  • Humanity Profile Picture
    278 on at

    @WarrenBelz 

     

    Your formula is causing it to post entirely new records?

     

    Please ignore the U.K. ... it is rogue.

     

    z.PNG

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Humanity 

    Yes the formula you should be using is:

     

    UpdateIf('Database Output 2',
     DB_ID='House DropDown_40'.Selected.DB_ID,
     {Jan_x0020_Elec_Provider:'IP Elec Provider UD_1'.Text}
    )

     

    If you use the other one, again it is missing the source record to patch. (and thus will just create new records)

    If you want to use a Patch versus an UpdateIf Then you would need this formula:

     

    Patch(
     'Database Output 2',
     Lookup('Database Output 2', DB_ID:'House DropDown_40'.Selected.DB_ID),
     {Jan_x0020_Elec_Provider:'IP Elec Provider UD_1'.Text}
    )

     

     

    They both do the same, but UpdateIf is faster in this case.

  • WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    @Humanity ,

    Firstly @RandyHayes 's UpdateIf (which I also use a lot) will certainly do the job for you however the syntax you actually may need if DBID is numeric is this.

    Patch(
     'Database Output 2',
     {DB_ID:Value('House DropDown_40'.Selected.DB_ID)},
     {Jan_x0020_Elec_Provider:'IP Elec Provider UD_1'.Text}
    )

    I use the syntax regularly and have just run a test at this end and it patches an existing record fine.

  • Humanity Profile Picture
    278 on at

    @WarrenBelz 

     

    When I read it, it makes perfect sense. BUT, it may be that my dropdown makes reference to another DB_ID, that has identical DB_ID columns and compares it to the DB being written to?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Humanity 

    The Patch statement without a corresponding record source has mixed results based on the DataSource.  Some datasources will support just providing and ID as the first record.

    To be completely sure that you are patching the correct record, you should provide what Patch wants, which is a datasource, a source record and an updated record to merge.

    Thus, on a patch, you should have the lookup of the actual FULL record as the datasource.  

    The UpdateIf doesn't need it, it just needs the filter for the records to update.  In your case, the DB_ID.

     

  • WarrenBelz Profile Picture
    156,750 Most Valuable Professional on at

    Without hijacking @Humanity 's post any further, it is interesting that this did not work as it is the first time I have struck this happening (generally a unique identifier always works with this). The Lookup syntax would be (needs equals)

     

    Patch(
     'Database Output 2',
     Lookup(
     'Database Output 2', 
     DB_ID='House DropDown_40'.Selected.DB_ID
     ),
     {Jan_x0020_Elec_Provider:'IP Elec Provider UD_1'.Text}
    )

     

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard