cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Need help to set combo box value with a button

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
 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).



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!

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I found this to fix my problem:

Set(var, LookUp(Choices('Collumn(DB)'),Value = 'Collumn (DB)'.'choiceName'))

Thank you for time @WarrenBelz  

View solution in original post

9 REPLIES 9
WarrenBelz
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

You have not provided the Items of the Combo Box, however the DefaultSelectedItems need to reflect that it contains a Table and for example if the output was MyComboName.Selected.Value and the column MyField was a Text column, then the DefaultSelectedItems would be

{Value: ThisItem.MyField}

If MyField was a Choice field then

{Value: ThisItem.MyField.Value}

 

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.

Visit my blog Practical Power Apps

 

Anonymous
Not applicable

Hi WarrenBelz,

Thank you for your answer,

I'm a little unsure about your solution, becuase how do i connect the function from my button to the combo box?
 I have also this to add:
Normally would the combo box have [Parent.Default] in DefaultSelectedItems and in items Choices(DB)

I also just checked the collumn and it is a YES/NO data type because it only has two options.

Thanks again

@Anonymous ,

You still have not provided the Items of the Combo Box - or is it Choices(Db) - that and the fields and type (and name) you are writing to determines the DefaultSelectedItems - can you please provide both of these.

Anonymous
Not applicable

@WarrenBelz 
The Items for the combo box is just Choices(DB) where DB is the table name
Collumn setting for the combo box:
Type = Custom
Data type = Yes/NO
Required: Yes

I made a mistake when i choose the data type for the collumn who has the combo box and ended up with the default YES/NO which i just changed to fit my two options. I dont know if that changes anything 🙂
Thanks

Hi @Anonymous ,

That is confusing - your Items  should refer to a column, not a table and Choices needs to be a Choice or Lookup field.

Choices(ListName.FieldsName)

and why are you writing a combo box back to a Boolean (Yes/No) field with a Text value?  I honestly have no idea what you are trying to achieve,

Anonymous
Not applicable

Hi @WarrenBelz 

Sorry but I'm new to powerapps and dataverse table, i just want to create an app where I can change the value of a input(fx combo box) which can represent the collumn in a form. The data can then be submitted to a table in a dataverse. I have setup all the connection and collumns I'm just not sure how which input would be the best for change a two value option with a button and how to do it right. 🙂

Thanks again

@Anonymous 

That really does not clarify it any better. I am not a Dataverse user (it is good to state your data souce in your post), but a combo box would normally require a Choice (option set in Dataverse) field to interact with.

Anonymous
Not applicable

Hi @WarrenBelz 

Sorry that i didnt calify enough that i was using Dataverse. 

Do you think the code would work if i changed the choice option from a combo box to a drop down box?
And is there something that i need to be aware of when i change a input in a form like this? 🙂

Thanks again


Anonymous
Not applicable

I found this to fix my problem:

Set(var, LookUp(Choices('Collumn(DB)'),Value = 'Collumn (DB)'.'choiceName'))

Thank you for time @WarrenBelz  

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,532)