cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Filter Gallery Help

Guys, I am working with a collection based on a Sharepoint list.

Formula: ClearCollect(colAciona ; 'Acionamentos 2018')

 

Im facing some issues on filtering, I need to filter based on 5 filters and I will add later a Date Filter.

 

My filters are like this:

 

Capturar.PNG

 

For now on, im using just the 2 firsts filters to test, with this formula:

 

 

Sort(
Filter(
colAciona;
StartsWith(
Ativo;
Filtro_Eqp_1.Text
);
StartsWith(
Prefixo_x0020_Trem;
Filtro_Trem_1.Text
)
);
ID;
Descending
))

 

 

But I noticed that the records are not showing properly on the Collection.

 

Capturar2.PNGCapturar3.PNG

 

Note that on the gallery I have only 1 record for the "ATIVO" - 9521 and "TREM" - Z52.

But now see on the Sharepoint list, I have 2 records for the same "ATIVO" but the "TREM" column is blank.

 

 

Capturar4.PNGCapturaR5.PNG

 

after i fill the "TREM" column in sharepoint list, the record shows up on the collection...

Im confunsing why this happens, is that a bug or what??

 

I cant keep this because im not going to have all the records all the time, sometimes one of the 5 filters will be blank, and will not show on the gallery...

I tried to do a IF function that don't filters when those 2 texts box are empty, but got no results..

Help please!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

Based on the formula that you provided, I have made a test, and the issue is confirmed on my side.

I think this issue is related to the StartsWith function within the formula that you provided.

When you just filter the collection based on the Ativo TextInput (leave blank within the Trem TextInput), the Filter formula would return records whose Ativo column starts with 9521 and Trem column starts with blank, in other words, the the record whose Ativo column starts with 9521 and Trem column starts with Z52 would be filtered out.

If you want to display all available records based on the 2 firsts filters, please take a try with the following workaround:

Set the Items property of the Gallery control to following formula:

 

SortByColumns(
Filter(
colAciona,
Filtro_Eqp_1.Text=""||Filtro_Eqp_1.Text in Ativo,
Filtro_Trem_1.Text=""||Filtro_Trem_1.Text in Prefixo_x0020_Trem
),
"ID",
Descending
)

On your side, you should replace the comma (,) with semicolon (;) within above formula as below:

 

 

SortByColumns(
    Filter(
       colAciona;
       Filtro_Eqp_1.Text=""||Filtro_Eqp_1.Text in Ativo;
       Filtro_Trem_1.Text=""||Filtro_Trem_1.Text in Prefixo_x0020_Trem
    );
 "ID";
Descending )

The GIF screenshot as below:Test1.gif

 

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @Anonymous,

Based on the formula that you provided, I have made a test, and the issue is confirmed on my side.

I think this issue is related to the StartsWith function within the formula that you provided.

When you just filter the collection based on the Ativo TextInput (leave blank within the Trem TextInput), the Filter formula would return records whose Ativo column starts with 9521 and Trem column starts with blank, in other words, the the record whose Ativo column starts with 9521 and Trem column starts with Z52 would be filtered out.

If you want to display all available records based on the 2 firsts filters, please take a try with the following workaround:

Set the Items property of the Gallery control to following formula:

 

SortByColumns(
Filter(
colAciona,
Filtro_Eqp_1.Text=""||Filtro_Eqp_1.Text in Ativo,
Filtro_Trem_1.Text=""||Filtro_Trem_1.Text in Prefixo_x0020_Trem
),
"ID",
Descending
)

On your side, you should replace the comma (,) with semicolon (;) within above formula as below:

 

 

SortByColumns(
    Filter(
       colAciona;
       Filtro_Eqp_1.Text=""||Filtro_Eqp_1.Text in Ativo;
       Filtro_Trem_1.Text=""||Filtro_Trem_1.Text in Prefixo_x0020_Trem
    );
 "ID";
Descending )

The GIF screenshot as below:Test1.gif

 

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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