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

Drop Down Default Item when Drop Down Items are from a collection

I am having an issue where I have a gallery setup with two drop downs, one for Equipment, and one for Department.  The Equipment and Department drop down Items property is set to pull from two collections, EquipCollection and DeptCollection, respectively.  The Default property for the two drop downs is set to ThisItem.SpecificEquipment and ThisItem.Department, respectively.  The source for the gallery that the drop downs are in are from a SharePoint list ("GAP") with two columns, SpecificEquipment and Department.  

 

My issue is that when I navigate away from the gallery onto another screen, and then back to the screen with the gallery, the dropdowns do not show the Default values, they show the first item in the respective dropdowns, in this case, "All Equipment" and "All Departments".  When I am in the app editor I can get the default values for the drop downs to show the correct values by simply cut and paste of the formulas, but then when I run the application and again navigate back and forth to the screen, then the same issue occurs of not showing the default value. 

 

I'm hoping that someone can help me with this strange issue.

Thanks!

 

 

2 REPLIES 2
Post Prodigy
Post Prodigy

What is the code for your button that you use to navigate back to the screen the dropdowns are on? Or, alternatively, the OnVisible of the screen they are on?

 

What I'm getting at is that it sounds like you have something that triggers during that "navigate away and then back) that is resetting those dropdowns? That's my first thought on what to check.

Frequent Visitor

The code use to navigate from the WelcomeScreen to the BrowseScreen:

Select(Parent);Navigate(BrowseScreen)

 

OnVisible code for BrowseScreen is:

ClearCollect(DeptCollection,{Result:" All Departments"});Collect(DeptCollection,Distinct(Filter('[dbo].[vw_ehs360_MOC_Equipment]_1',Equipment_Area = SitesGallery.Selected.Result),Equipment_Department));
ClearCollect(EquipCollection,{Result:" All Equipment"});Collect(EquipCollection,Distinct(Filter('[dbo].[vw_ehs360_MOC_Equipment]_1',Equipment_Area = SitesGallery.Selected.Result),Equipment_Name));
Set(SortDescending1,false); Set(SubmitGroupVisible,false);
Set(varEdit,false); Set(varDeleteVisible1,false); Set(varSubmitVisible1,false)

ClearCollect(DeptCollection,{Result:" All Departments"});Collect(DeptCollection,Distinct(Filter('[dbo].[vw_ehs360_MOC_Equipment]_1',Equipment_Area = SitesGallery.Selected.Result),Equipment_Department));
ClearCollect(EquipCollection,{Result:" All Equipment"});Collect(EquipCollection,Distinct(Filter('[dbo].[vw_ehs360_MOC_Equipment]_1',Equipment_Area = SitesGallery.Selected.Result),Equipment_Name));
Set(SortDescending1,false); Set(SubmitGroupVisible,false);
Set(varEdit,false); Set(varDeleteVisible1,false); Set(varSubmitVisible1,false)

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (82,353)