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

Gallery : how to reference collection to splist with choice col.

Hi All,

 

I'm trying to set a filter on my gallery based on the following collections. 

ViswaDevanNair_0-1638102335588.png

 

I have the following collection written in the App OnStart function

 

ClearCollect(
colNew,
{
ID: 1,
Name: "All PEACE",
Logo: Icon.DetailList
},
{
ID: 2,
Name: "NEW",
Logo: Icon.Document
},
{
ID: 3,
Name: "PENDING",
Logo: Icon.Tools
},
{
ID: 4,
Name: "IMPLEMENTED",
Logo: Icon.Manufacture
}
,
{
ID: 5,
Name: "OVERDUE",
Logo: Icon.Warning
}
,
{
ID: 6,
Name: "DECLINED",
Logo: Icon.Blocked
}
);

 

My Sharepoint List STATUS col is a choice column. 

Choice are 

1. NEW

2. PENDING

3. IMPLEMENTED

4. OVERDUE

5.DECLINED

As you can see the choice of my Sharepoint list is the same as the colNew Name. 

 

I'm trying to filter the gallery based on the above but i'm unable to find the correct filter. 

 

Please refer to the appscreen below for the expected filtering behavour from my gallery. 

I had to use multiple gallery to get the below result. 

PEACE.gif

I'm pretty sure there should be an easier way to do the filtering. 

 

Please do let know where I went wrong. 

 

Thank you. 

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
CNT
Super User
Super User

@ViswaDevanNair When you say, Status.Value=colNew.Name you are not referring to one value. colNew is a collection with 5 records. That's why you are getting the error.

From your screen shot, I believe colNew should be the Items for the left gallery. In that case, your formula will be,

Status.Value=leftGallery.Selected.Name

 

Also, note that you are missing a close bracket in the end.

View solution in original post

Hi CNT,

 

Thank you.

It works now. and yes I was referencing the filter selection to the left gallery. 

The following is the revised filter for the items property. 

 

ViswaDevanNair_0-1638142673631.png

 

 

View solution in original post

@ViswaDevanNair 

Glad it help!

 

Please remember to give a 👍 and accept my solution as it will help others in the future.

View solution in original post

5 REPLIES 5
Daved1
Helper II
Helper II

I would create a new collection for each filter condition.  You could add a combo box with your filter conditions.  then use the OnChange of the comboBox to re-create a new collection with the selected filter applied.

off the top of my head....

 

ClearCollect(

     colFiltered,

        Filter( colNew,

           Name=comboFilter.Selected.Value

        )

      )

CNT
Super User
Super User

@ViswaDevanNair When you say, Status.Value=colNew.Name you are not referring to one value. colNew is a collection with 5 records. That's why you are getting the error.

From your screen shot, I believe colNew should be the Items for the left gallery. In that case, your formula will be,

Status.Value=leftGallery.Selected.Name

 

Also, note that you are missing a close bracket in the end.

Hi CNT,

 

Thank you.

It works now. and yes I was referencing the filter selection to the left gallery. 

The following is the revised filter for the items property. 

 

ViswaDevanNair_0-1638142673631.png

 

 

HI Daved1. 

 

Thank you for the suggestion. 

I'm avoiding the use of a combo box as it doesn't suit my overall app design. 

 

Thank you. 

@ViswaDevanNair 

Glad it help!

 

Please remember to give a 👍 and accept my solution as it will help others in the future.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,026)