cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChrisInTexas
Level: Powered On

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
Level 10

Re: Dropdown field is initially blank

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

11 REPLIES 11
hpkeong
Level 10

Re: Dropdown field is initially blank

Hi @ChrisInTexas

 

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
Level 10

Re: Dropdown field is initially blank

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

ChrisInTexas
Level: Powered On

Re: Dropdown field is initially blank

Thanks for your help, you got me going in a good direction. I have everything working now.
knutarst
Level: Powered On

Re: Dropdown field is initially blank


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.

Highlighted
ChrisInTexas
Level: Powered On

Re: Dropdown field is initially blank

Thanks to JRaasumaa I used a collection for the items.

 

There is no latency now, works perfectly.

 

--Chris

AlexN
Level 8

Re: Dropdown field is initially blank

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
Level: Powered On

Re: Dropdown field is initially blank

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

AlexN
Level 8

Re: Dropdown field is initially blank

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)
MK1
Level: Powered On

Re: Dropdown field is initially blank

@AlexN,

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

 

Thanks,

MK

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (3,762)