cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrendanZ1
Helper V
Helper V

Setting a dropdown default value that filters a gallery

Hi - I have a gallery that currently has two dropdowns for filtering.

1.Approval Status

2. Job Status

 

Both of these are based on collections using data from their own separate SP lists.

 

I have everything working, with exception of getting the ApprovalStatus dropdown, to always have "Approved" as the selection.

The idea being that workers don't need to see tasks that haven't been approved for scheduling (basically requests that have been rejected in the first stage of the request process).

 

I have tried changing the 'Default' value for the dropdown to "Approved", but it resets to "All" each time I leave the screen and come back. I have tried an onVisible so that the dropdown selects "Approved", but this doesn't work also.

 

The selection options in the Approval Status list are:

-

Approved

Rejected

Deferred

 

I use a ClearCollect to bring the 'All' option in.

 

If working correctly, when staff look at current tasks, they will see all tasks that have been approved. They can then filter this list based on job status. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

What is the Items property of the dropdown for approval status?

One simple resolution is to populate your collection with "Approved" as the first value. If that's not ideal, try this as the default value:

Assuming approvalStatusColl is the collection name:
LookUp(approvalStatusColl, Value = "Approved")

Another option is to use a combo box but we will get to that only if needed.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

5 REPLIES 5
Drrickryp
Super User II
Super User II

Hi @BrendanZ1 

Could you please post the Items property of your gallery?

Yep @Drrickryp  no worries;

 

If(ddApprovalStatus.Selected.AprrovalStatus = "All" And JobStatusDropDown.Selected.JobStatus = "All", WorkOrderList,
JobStatusDropDown.Selected.JobStatus ="All" And ddApprovalStatus.Selected.AprrovalStatus <> "All",
Filter(WorkOrderList, ApprovalStatus = ddApprovalStatus.Selected.AprrovalStatus),
JobStatusDropDown.Selected.JobStatus <> "All" And ddApprovalStatus.Selected.AprrovalStatus <> "All",
Filter(WorkOrderList, ApprovalStatus = ddApprovalStatus.Selected.AprrovalStatus And JobStatus = JobStatusDropDown.Selected.JobStatus)
)

 

While this is enabling choice for the ApprovalStatus dropdown, I want it set to approved only. If there is another way to do this without using a dropdown, I am open to that suggestion too.

What is the Items property of the dropdown for approval status?

One simple resolution is to populate your collection with "Approved" as the first value. If that's not ideal, try this as the default value:

Assuming approvalStatusColl is the collection name:
LookUp(approvalStatusColl, Value = "Approved")

Another option is to use a combo box but we will get to that only if needed.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Thanks @PowerAddict  while it isn't ideal, I have changed the collection to grab "Approved" first. It isn't a big deal though as the dropdown will be hidden anyway.

 

Incidentally, the LookUp option didn't seem to want to work.

 

Thanks again

Awesome! Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Side note: Can you please share the error you were getting with the LookUp function?

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

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 is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (26,802)