web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to filter a galler...
Power Apps
Answered

How to filter a gallery based on folder location AND first 10 characters of filename

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a Gallery (Gal_Images) that is happily showing thumbnails of images that are in a folder location, these images are named under the convention "mtg-xxxxxx-yyyymmdd-description.jpg" 

Where

'mtg; denotes a meeting ID , 'yyyymmdd' is the date and 'description' is a free field

 

Examples

mtg-000001-20230230-bird.jpg

mtg-000001-20230230-dog.jpg

mtg-000001-20230230-cat.jpg

mtg-000002-20230305-snake.jpg

mtg-000002-20230305-fish.jpg

 

My folder structure is in Sharepoint, so the gallery Gal_Images Items is set to :

 

Filter('MyDocumentLibrary','Folder path'="Top Level Folder/Project Folder/Image Files/")

 

This works fine

 

What I am trying to do is to limit the Gallery Gal_Images to ONLY show the files where the first 10 characters match that of a meeting ID that is selected from another Gallery (Gal_Meeting)

 

If I set a label to show "GalMeeting.Selected.MeetingID" I see the meeting ID I am trying to match against

 

I have been trying various combinations of 'and' statements and using the 'Left' function, but cannot get it quite right!

 

Very grateful for any steer anyone can give me, 

 

James

 

 

Categories:
I have the same question (0)
  • Verified answer
    JD382 Profile Picture
    114 on at

    You can use StartsWith in the Filter to select the items you want.

     

    Filter(
        'MyDocumentLibrary',
        'Folder path' = "Top Level Folder/Project Folder/Image Files/",
        StartsWith(Filename, GalMeeting.Selected.MeeingID)
    )

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    JD383, Thank you very much!, 

    This solved my issue in a heartbeat. Very much obliged to you.

    James

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard