cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShaSha
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
notj
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.

ShaSha
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
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

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,912)