cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Snowflakethepon
Frequent Visitor

Combobox DefaultSelectedItem

Hi,

 

I would like to select a value for my Super Power Combobox after the component gets reset (I have made the reset work). I navigate and set a parameter called SearchFor from another form that creates a new Super Power.
Like so:

 

SubmitForm(EditSuperPower);Navigate(EditScreen1, ScreenTransition.None, {SearchFor: DataCardValue7.Text});

 

 

I want the new Super Power which name is saved in the SearchFor to be selected in the combobox. I have the following formular on it.

 

Filter(Choices([@Ponies].cr8d6_SuperPower), Value = SearchFor)

 

 It gives an error: "Name isn't valid". 

Also tried the solution from this: https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-filter-choices-on-Combobox/td-p/10143...

Gives the same error on the Value.

 

Thanks for all suggestions in advance

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Snowflakethepon ,

 

Noticing that you are working with Dataverse, and the SuperPower column is a LookUp column in the table, am I right?

 

If so, you will need the name of a column in SuperPower table, which is the Ponies table LookUp column "SuperPower"  looks up to, instead of "Value".

 

For example, I have a LookUp column "AAAA" in Table1, which Looks up to table AAAA, so I would set the DefaultSelectItems of the Combo box to:

 

LookUp(Choices([@Table1].'AAAA (crba2_new_aaaa)'),AAAA = SearchFor)

 

 

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.

View solution in original post

3 REPLIES 3
JR-BejeweledOne
Super User
Super User

Is SearchFor another field or a context variable?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Context variable - Coming in from another form.

Formular of the Combobox:
ComboBox_DefaultSelectedItem_Formular.PNG

Formular of the Submit button on the form that passes the SearchFor parameter:
SecoundaryForm_Submit_PassParameter_Formular.PNG

v-jefferni
Community Support
Community Support

Hi @Snowflakethepon ,

 

Noticing that you are working with Dataverse, and the SuperPower column is a LookUp column in the table, am I right?

 

If so, you will need the name of a column in SuperPower table, which is the Ponies table LookUp column "SuperPower"  looks up to, instead of "Value".

 

For example, I have a LookUp column "AAAA" in Table1, which Looks up to table AAAA, so I would set the DefaultSelectItems of the Combo box to:

 

LookUp(Choices([@Table1].'AAAA (crba2_new_aaaa)'),AAAA = SearchFor)

 

 

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.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (44,889)