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

Collection list not being built

I'm very new at this, so I have an import of a powerapp that I am using to build my app.  The problem I am having is with the collections in the app.  There doesn't appear to be any initial list of items in either collection.  The collections are named "states" and "sector".  The only code I find related to this is:

ClearCollect(states, {Result: "All"});
Collect(states, Sort(Distinct(Project_1,PLANT_CITY).Result,Result,Ascending));
ClearCollect(sector, {Result: "All"});
Collect(sector, Sort(Distinct(Project_1,IND_DESC).Result,Result,Ascending))

 

However, when I run the app a face two issues:

1. The app does not seem to build an initial list for either collection.

2. The default for the first dropdown is set as:    states   , but is expecting text.

 

In the original app this code produces a dropdown list for states that starts with All and also lists individual states.  The sector dropdown also starts with All and lists the individual sectors. 

 

Does anyone have any  suggestions

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Collection list not being built

@Marke525 

Where is your Formula you showed in your App?  Perhaps in the OnStart? 

Also, just as an FYI - you can shorten into one statement for each with this Formula:

ClearCollect(states, {Result: "All"}, Sort(Distinct(Project_1,PLANT_CITY).Result,Result,Ascending)));
ClearCollect(sector, {Result: "All"}, Sort(Distinct(Project_1,IND_DESC).Result,Result,Ascending)))

 As for the DropDown, you will need to put the Collection on the Items property, not on the Default property. 

Default on a DropDown is a text property that sets the selected item in the DropDown if desired.

 

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.

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: Collection list not being built

@Marke525 

Where is your Formula you showed in your App?  Perhaps in the OnStart? 

Also, just as an FYI - you can shorten into one statement for each with this Formula:

ClearCollect(states, {Result: "All"}, Sort(Distinct(Project_1,PLANT_CITY).Result,Result,Ascending)));
ClearCollect(sector, {Result: "All"}, Sort(Distinct(Project_1,IND_DESC).Result,Result,Ascending)))

 As for the DropDown, you will need to put the Collection on the Items property, not on the Default property. 

Default on a DropDown is a text property that sets the selected item in the DropDown if desired.

 

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.

View solution in original post

Highlighted
Frequent Visitor

Re: Collection list not being built

Thanks Randy!  That was helpful.  Cleaner coding too. 

The formula was in OnVisible.

 

I'm a step closer now.  I appreciate it.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,299)