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

FILTER IMAGE GALLERY - AZURE BLOB STORAGE

Hi there!

I have managed to follow Shaun Young's great tutorial to create a gallery that stores and displays photos using Azure blob storage.

However, I don't want to show every photo in the collection - just the photos relating to the particular job number reference.

 

This is the OnSelect for the button to save the photos (using the AddPicture control):

AzureBlobStorage.CreateFile("powerappsphotos",Concatenate(DataCardValue2.Text,TextInput4_1.Text),AddMediaButton1_1)

This enables the photo filename to begin with the relevant job number (ie. DataCardValue2.Text).  All good so far.

 

I have created another screen with the photo gallery itself, and it displays photos from the blob storage correctly

Screen 2: OnVisible: ClearCollect(CollectFiles,AzureBlobStorage.ListFolderV2("JTJmcG93ZXJhcHBzcGhvdG9z").value

But it displays all the photos in that blob storage container.

 

How can I make the gallery display only photos with filename that begins with the DataCardValue2.Text?

 

Perhaps I am going about this the wrong way - and I should be creating a new collection instance each time, that refers to the DataCardValue2.Text?

 

Either way, this is beyond my capabilities, so hoping you can help or send me in the right direction.

Many thanks in advance.

 

 

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @KQ ,

Do you want to filter the Blob metadata collection based on DataCardValue2.Text?

I've searched the structure of BlobMetadata:

Name Path Type Description
Id
Id string

The unique id of the file or folder.

Name
Name string

The name of the file or folder.

DisplayName
DisplayName string

The display name of the file or folder.

Path
Path string

The path of the file or folder.

LastModified
LastModified date-time

The date and time the file or folder was last modified.

Size
Size integer

The size of the file or folder.

MediaType
MediaType string

The media type of the file or folder.

IsFolder
IsFolder boolean

A boolean value (true, false) to indicate whether or not the blob is a folder.

ETag
ETag string

The etag of the file or folder.

FileLocator
FileLocator string

The filelocator of the file or folder.

Try this formula:

Filter(CollectFiles,StartsWith(DataCardValue2.Text,Name))

 Here's a doc about this api for your reference:

https://docs.microsoft.com/en-us/connectors/azureblob/#blobmetadatapage

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

Hi @KQ ,

Do you want to filter the Blob metadata collection based on DataCardValue2.Text?

I've searched the structure of BlobMetadata:

Name Path Type Description
Id
Id string

The unique id of the file or folder.

Name
Name string

The name of the file or folder.

DisplayName
DisplayName string

The display name of the file or folder.

Path
Path string

The path of the file or folder.

LastModified
LastModified date-time

The date and time the file or folder was last modified.

Size
Size integer

The size of the file or folder.

MediaType
MediaType string

The media type of the file or folder.

IsFolder
IsFolder boolean

A boolean value (true, false) to indicate whether or not the blob is a folder.

ETag
ETag string

The etag of the file or folder.

FileLocator
FileLocator string

The filelocator of the file or folder.

Try this formula:

Filter(CollectFiles,StartsWith(DataCardValue2.Text,Name))

 Here's a doc about this api for your reference:

https://docs.microsoft.com/en-us/connectors/azureblob/#blobmetadatapage

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

how did you do this ? 

I have almost same case. But i simply have a textinput and a gallery. I want to insert some text then display images in the gallery based on the text thats inserted into the textfield, but i want to make a startswith filter. So show all images that startswith "example string" 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

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,598)