Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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

Categories:
  • AshleyTaylor Profile Picture
    on at
    Re: Passing a value from label to combo box using a variable

    Perfect, Thanks!

  • Verified answer
    v-jefferni Profile Picture
    on at
    Re: Passing a value from label to combo box using a variable

    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
    Re: Passing a value from label to combo box using a variable

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

     

    Please see form data sources in attached diagram

     

    Thanks

  • v-jefferni Profile Picture
    on at
    Re: Passing a value from label to combo box using a variable

    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
    Re: Passing a value from label to combo box using a variable

    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 

  • v-jefferni Profile Picture
    on at
    Re: Passing a value from label to combo box using a variable

    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
    Re: Passing a value from label to combo box using a variable

    I would really appreciate any help with this 

  • AshleyTaylor Profile Picture
    on at
    Re: Passing a value from label to combo box using a variable

    Can anyone point me in the right direction? 

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard