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 / Trying to set combo bo...
Power Apps
Unanswered

Trying to set combo box value with the press of a button

(0) ShareShare
ReportReport
Posted on by

Hi all,

I'm new to powerapps and dataverse, and i have run into a problem that i feel like i have used too much time on now.
In my powerapp I'm trying to use the SET and LOOKUP function to set a value in a combo box via a press of a button. The Combo box is connected to a dataverse form. The dataverse table is connected in the powerapp.



The thing i tried was:
Button(OnSelect): Set(Var,LookUp(DB, columnName = "Bla Bla"))
Combo Box(DefaultSelectedItems): Var
But here i get the "These types cant be compared: DB, text"


Then i tried this function:
Button(OnSelect): Set(Var,LookUp(DB,"Bla Bla" in columnName))
Combo Box(DefaultSelectedItems): Var

Here is a little info box:
Var = Just a variable
DB = Table name
columnName = Table column name
"Bla Bla" = Combo box option

Let me know if anything is unclear - Thanks!

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    I totally forgot to add the error i got from the 2nd function.

    But when i use the function: Button(OnSelect): Set(Var,LookUp(DB,"Bla Bla" in columnName)) I get the runtime error: Server Response: DB failed: No function signature for the function with name 'contains' matches the specified arguments. The function signatures considered are: contains(Edm.String Nullable=true. Edm.String Nullable=true).

  • v-jefferni Profile Picture
    on at

    Hi @Anonymous ,

     

    Could you please tell the Items of the Combo box? Since the selected items should be one or more records that exist in the table, on your end you need to make sure the Items property is the DB Dataverse table as well.

     

    I made a simple test for your reference:

    vjefferni_1-1651225416011.png

    vjefferni_0-1651225404390.png

     

    If the Items and the Set function share different data sources, you need use another LookUp function in DefaultSelectedItems to get the corresponding record.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-jefferni,
    Thank you for your answer 🙂
    I have added both items to the datastore collumn and then i tried this:
    Employment/Combo box:

    RealMABN_3-1651231786421.png
    I tried with just userDBS (which is the table name), but without any success.



    Button:

    RealMABN_2-1651231696819.png
    I get this "error" but could it be that i need to use the Text() function?



    When i select an item from the combo box then i can see both options

     

    RealMABN_0-1651231089145.png

     



  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @Anonymous ,

     

    So it is a Choice column (Option Set) of Dataverse. I made a test for your reference:

    vjefferni_2-1651632088783.png

    vjefferni_3-1651632100698.png

    Set(var, LookUp(Choices('Employment (UserDBS)'),Value = 'Employment (UserDBS)'.'White Collar'))

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-jefferni,

    Thank you so much. This helps alot! 🙂

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard