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 / Passing a value from l...
Power Apps
Answered

Passing a value from label to combo box using a variable

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

I am trying to pass a value from a label in an edit form to a combobox in a different edit form. I have set a variable that is trigged by a new buttons OnSelect Set(label1.Text) and in the combo box DefaultSelectedItem Table({Value:Var}).

 

This works as expected however when I click my save button OnSelect SubmitForm('Form1'). I get the following error message in the combo box datacard 'Value must be a data entity record'

 

Can anyone advise?

 

Thanks

error value1.jpg
Categories:
I have the same question (0)
  • AshleyTaylor Profile Picture
    on at

    Can anyone point me in the right direction? 

  • AshleyTaylor Profile Picture
    on at

    I would really appreciate any help with this 

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @AshleyTaylor ,

     

    It seems that the Combo box is used for a LookUp column, if this is the case, please try below formula:

    LookUp(ComboBoxItems, Value = var)

    ComboBoxItems means the formula Choices(...) in Items of the Combo box.

     

    Best regards,

  • AshleyTaylor Profile Picture
    on at

    Thanks for your reply,

     

    The combo box is indeed used for a lookup column

    (AssemblySpec Lookup is in tblToolsForAssemblies with has a many to one relationship with tblAssemblies which contains column AssembliesPK - This is the value I need passing to the combo box)

     

    I have just tried:

    LookUp(tblAssemblies,Value = Var)

     

    but I am getting 'incompatible types for comparison, these types can't be compared error, text' 

     

    Please see attached error and ER Diagram

     

    Thanks 

    error combo.jpg
    ER Diagram Updated.jpg
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @AshleyTaylor ,

     

    I was thinking you are using SharePoint lists as data sources. But it seems not the case. Could you please confirm this? What data source are you using for the form?

     

    Best regards,

  • AshleyTaylor Profile Picture
    on at

    Sorry, I forgot to specify all my tables/relationships are in Dataverse.

     

    Please see form data sources in attached diagram

     

    Thanks

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @AshleyTaylor ,

     

    OK, then DefaultSelectedItems of the Combo box:

    LookUp(tblAssemblies, AssembliesPK = Var)

     

    Actually, there is no need to use the variable, you can use the AssembliesPKlabel.Text directly:

    LookUp(tblAssemblies, AssembliesPK = AssembliesPKlabel.Text)

     

    Best regards,

  • AshleyTaylor Profile Picture
    on at

    Perfect, Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 617

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard