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

Displaying images from a dynamic file path in Sharepoint

Hi all, 

 

I'd be most grateful if anyone could advise where I'm going wrong. I have created an app whereby users can capture an image using their device camera, enter a 'clientref' and a 'projectref' and these images are then uploaded to Sharepoint using those variables to create a unique filepath. They go to Projects/ClientRef/ProjectRef/Pictures. This all works fine.

 

On another screen, the clientref and projectref variables are passed through and I'd like to display the images from that folder in a gallery. I've connected the Projects list then I get stuck as I cannot filter just the relevant folder. I tried Filter(Projects,Concatenate(ClientRef,"/",ProjectRef,"/pictures")) but that doesn't work at all. How do I resolve this?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @PwrApps ,

Regarding the needs that you mentioned, I think the solution I provided above could achieve your needs. Could you please share a screenshot about the folder structure in your SP Library?

 

Please note that the 'Folder Path' attribute is case-sensitive, so please make sure you have specified proper Folder Name, Library Name within your Filter formula. E.G. Your image files would be stored under the "pictures" folder, so you need to specify 'pictures' folder name in your Filter formula rather than 'Pictures', your Filter formula would like below:

Filter(
        Projects,
        Concatenate("Projects", "/", ClientRef, "/", ProjectRef, "/pictures") in 'Folder path'
)

or

Filter(
        Projects,
        Concatenate("Projects", "/", ClientRef, "/", ProjectRef, "/pictures/") in 'Folder path'
)

or

Filter(
        Projects,
        Concatenate("Projects", "/", ClientRef, "/", ProjectRef, "/") in 'Folder path'
)

You also need to check if the dynamic ClientRef value and ProjectRef value could match the proper folder name in your SP Library (Folder name is case-sensitive).

 

Please try above solution, then check if it could help in your scenario.

 

Regards,

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

3 REPLIES 3
v-xida-msft
Community Support
Community Support

Hi @PwrApps ,

How do you upload images back to your SP Library? Using Power Automate flow?

Does the Projects represents your SP Library?

 

Regarding the needs that you mentioned, I suppose that you want to filter files stored in your SP Library folder based on the dynamic 'clientref' and a 'projectref' value, is that true?

 

I have made a test on my side, please consider modify your formula as below (set the Items property of the Gallery to following😞

Filter(
        Projects,
        Concatenate("Projects", "/", ClientRef, "/", ProjectRef, "/Pictures") in 'Folder path'
)

or

Filter(
        Projects,
        'Folder path' = Concatenate("Projects", "/", ClientRef, "/", ProjectRef, "/Pictures", "/")
)

 

Please try above solution, then check if the issue is solved.

 

Regards,

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.

Hi @v-xida-msft 

 

Thanks for your reply.

 

I upload pictures to Sharepoint using the statement below (which calls on a Flow):

 

UploadProjectImage.Run(Concatenate(ClientRef,"_",ProjectRef,"_picture"),ThisItem.Url, Concatenate(ClientRef,"/",ProjectRef))

 

Yes, I want to filter the photos displayed in the gallery by the unique file path created in Projects in the last step. This uses the clientref and projectref to create the filepath.

 

I have tried your two solutions below but still nothing appears in my gallery. I'm not sure where I'm going wrong.

Hi @PwrApps ,

Regarding the needs that you mentioned, I think the solution I provided above could achieve your needs. Could you please share a screenshot about the folder structure in your SP Library?

 

Please note that the 'Folder Path' attribute is case-sensitive, so please make sure you have specified proper Folder Name, Library Name within your Filter formula. E.G. Your image files would be stored under the "pictures" folder, so you need to specify 'pictures' folder name in your Filter formula rather than 'Pictures', your Filter formula would like below:

Filter(
        Projects,
        Concatenate("Projects", "/", ClientRef, "/", ProjectRef, "/pictures") in 'Folder path'
)

or

Filter(
        Projects,
        Concatenate("Projects", "/", ClientRef, "/", ProjectRef, "/pictures/") in 'Folder path'
)

or

Filter(
        Projects,
        Concatenate("Projects", "/", ClientRef, "/", ProjectRef, "/") in 'Folder path'
)

You also need to check if the dynamic ClientRef value and ProjectRef value could match the proper folder name in your SP Library (Folder name is case-sensitive).

 

Please try above solution, then check if it could help in your scenario.

 

Regards,

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!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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