cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
onyebuchiboss
Helper III
Helper III

How to use multiple filter to filter a datsource for gallery items

Hi All, 

I have seen examples online but none meets my requirements. I want to use multiple filters to filter out items in a datasource used to populate the items in a gallery, I have something like;

 

If(ExcludeInput.Text<>"",Filter(newResults, Not(ExcludeInput.Text in metadata_storage_name)),newResults)

If(!IsEmpty(DeletedRecords),Filter(newResults, Not(metadata_storage_path in DeletedRecords.metadata_storage_path)),newResults)

 

 

How do I merge both filters to make it work, I want to remove items typed in the "excludeInput" text box and as well items in the "DeletedRecords" data source.

 

Thank you.

@RezaDorrani can you help pls?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@onyebuchiboss 

Ah yes, I see there was a paren missing.  Should have been:

Filter(newResults,  
    (IsBlank(ExcludeInput.Text) || !(ExcludeInput.Text in metadata_storage_name)) &&
    ((CountRows(DeletedRecords)=0) || !(metadata_storage_path in DeletedRecords.metadata_storage_path))
)

 

So what part is not working and elaborate on what is happening and expected.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

11 REPLIES 11
RandyHayes
Super User III
Super User III

@onyebuchiboss 

Please consider changing your Formula to the following:

Filter(newResults,  
    (IsBlank(ExcludeInput.Text) || !(ExcludeInput.Text in metadata_storage_name) &&
    ((CountRows(DeletedRecords)=0) || !(metadata_storage_path in DeletedRecords.metadata_storage_path))
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Thanks for responding Randy, but the system wouldn't recognise the DeletedRecods.metedata_storage_path, even though it obviously in the collection properties.

RandyHayes
Super User III
Super User III

@onyebuchiboss 

How are you defining that DeletedRecords table?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Sorry, but this ddnt work.

It is a collection of items from the gallery, since it is deleted, I do not want users seeing it.

RandyHayes
Super User III
Super User III

@onyebuchiboss 

How are you defining that DeletedRecords table?  What is the formula?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

I was able to finally use your suggestion, your formula just only needed an extra bracket, just still not working. this is how I collect the DeletedRecords;

Collect(
    DeletedRecords,
    {
        id: "1",
        metadata_storage_path: galleryResults.Selected.metadata_storage_path,
        decoded_path: decoded_path2,
        deletion_scheduled_date: Text(Now(),"[$-en-US]yyyy-mm-dd"),
        deletion_scheduled: true,
        who_deleted: User().FullName,
        who_marked_deleted: User().FullName
    });
RandyHayes
Super User III
Super User III

@onyebuchiboss 

Ah yes, I see there was a paren missing.  Should have been:

Filter(newResults,  
    (IsBlank(ExcludeInput.Text) || !(ExcludeInput.Text in metadata_storage_name)) &&
    ((CountRows(DeletedRecords)=0) || !(metadata_storage_path in DeletedRecords.metadata_storage_path))
)

 

So what part is not working and elaborate on what is happening and expected.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

I can see the records in the DeleteRecords collection, and can still see the records in the gallery, so the filter isn't working.

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (53,577)