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

Dropdown field is initially blank

Hello, I have been a software developer for 20 years but I am brand new to PowerApps.

 

I have a Sharepoint Online list with a Lookup column in it that gets data from another Sharepoint list. I have no problems with the list or lookup column when using Sharepoint Online.

 

But, PowerApps does not populate the dropdown field the first time the screen is accessed, it is blank, the other fields (Textboxes) are populated as expected. I have to manually click the dropdown to get the lookup data to populate, then the dropdown functions as expected for each record (the lookup value is in the dropdown).

 

I can put a Label on the datacard and it populates every time with the list data, but the dropdown is blank (on the first record). The dropdown requires a manual click to open the connection to Sharepoint Online the first time the Edit screen is accessed.

 

What am I doing wrong?

 

Is there a way to force the dropdown to get the Sharepoint lookup data before the dropdown populates so that the dropdown will have the lookup data the first time I access the Edit screen?

 

Thanks in advance for your help.

--Chris

1 ACCEPTED SOLUTION

Accepted Solutions
JRaasumaa
Memorable Member
Memorable Member

My suggestion is to use the OnVisible property of your screen (or a button click) to load the Sharepoint list into a collection using Distinct.

 

 

For example:

 

I have collection DropCollect gather all my Quote Numbers into it using:

 

ClearCollect(DropCollect,Distinct(QuoteNumberMerged,QuoteNumber))

Then in my dropdown I use "Drop Collect" as my items property.

 

And last I have my Default property set to the last item in the list with:

 

Last(DropCollect).Result

 

This means when my screen loads I get the full list of distinct values into my dropdown and the last value in that list is loaded.

 

View solution in original post

13 REPLIES 13
hpkeong
Community Champion
Community Champion

Hi @Anonymous

 

May you re-check if you set your Dropdown.Items = Distinct(Table, Field) correctly?

Once it is written with Distince, definteily it will populate as the as the Table from SPL is connected.

 

Then, use either Filter (for table) or LookUp(for single data) to filter table based on the dropdown.

 

Hope this helps.


TQ

hpkeong
JRaasumaa
Memorable Member
Memorable Member

My suggestion is to use the OnVisible property of your screen (or a button click) to load the Sharepoint list into a collection using Distinct.

 

 

For example:

 

I have collection DropCollect gather all my Quote Numbers into it using:

 

ClearCollect(DropCollect,Distinct(QuoteNumberMerged,QuoteNumber))

Then in my dropdown I use "Drop Collect" as my items property.

 

And last I have my Default property set to the last item in the list with:

 

Last(DropCollect).Result

 

This means when my screen loads I get the full list of distinct values into my dropdown and the last value in that list is loaded.

 

Anonymous
Not applicable

Thanks for your help, you got me going in a good direction. I have everything working now.


Hi ChrisInTexas
I have the same problem as you describe, i.e. the dropdown requires a manual click to open the connection to Sharepoint Online the first time the Edit screen is accessed.
Could you write a few words about what you did to make this work properly.

Anonymous
Not applicable

Thanks to JRaasumaa I used a collection for the items.

 

There is no latency now, works perfectly.

 

--Chris

Nice solution, but unfortunately, this doesn't work when using a form and datacards for the entries, as they are not loaded until you click on the field. Only then the entries are calculated and the system is able to choose the default one. At least this is what I observed

MK1
Helper IV
Helper IV

Hi,

In my screnario,

I need to get values into the dropdown from a swagger custom connetion.

 

Is there any way to get values from swagger into a dropdown.

i tried to get user infromation using custom connection, but here i'm trying to get more than 10 values into a dropdown using a custom swagger connection.

Please let e know if anyone have tried this.

 

Thanks in advance

Haven't tried this directly but I think this should definitely work.

The only thing I would suggest is to collect all entries beforehand and then use the collection in the items field, and not use the custom connection values directly there (it could work, but I guess the first approach might be a bit more stable)

@AlexN,

can you explain a bit in detail, so that i can try.

 

Thanks,

MK

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,949)