cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omi18
Post Patron
Post Patron

Combo Box Default Value

Hello,

 

I'm trying to set a Default value for ComboBox. Below is my current formula. 

LookUp('database',ID=Gallery1.Selected.AccountID,AccountName)

 

What I'm missing from the formula? 

 

Thanks,

Omi

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@omi18 

Then with that your Items property is a Table of records with a single column called Result.

Your DefaultSelecteItems property should be:

    {Result: LookUp('database',ID=Gallery1.Selected.AccountID,AccountName)}

 

And possibly, since it appears that the Gallery might have the AccountName in it already...you can skip the lookup and use:

    {Result: Gallery1.Selected.AccountName}

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@omi18 

First, the Default property on a Combobox does nothing.  You need to set the DefaultSelectedItems (DSI) property.

 

You must set it to a record or table that corresponds to your records schema of the Items property of the Combobox.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
omi18
Post Patron
Post Patron

Hi @RandyHayes ,

 

I have ComboBox Iteme property set to: Sort(Distinct('database'.AccountName,AccountName),Result,Ascending)

 

Thanks,

Omi

RandyHayes
Super User III
Super User III

@omi18 

Then with that your Items property is a Table of records with a single column called Result.

Your DefaultSelecteItems property should be:

    {Result: LookUp('database',ID=Gallery1.Selected.AccountID,AccountName)}

 

And possibly, since it appears that the Gallery might have the AccountName in it already...you can skip the lookup and use:

    {Result: Gallery1.Selected.AccountName}

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

@RandyHayes ,

 

It worked. 

 

Thanks. 

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!

Top Solution Authors
Top Kudoed Authors
Users online (68,833)