cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtagliaferri
Resolver I
Resolver I

Deleting JPG File in a Photo Library Error

I have a flow that needs to delete a .jpg file from a sharepoint library, this library is a photo library.

I am trying to delete via the name of the file.

I thought initially I needed to ge File properties but I cannot find the folder using this action, therefore I am using directly a delete

The File identifier returns the exact name of the file in the library.

When running the flow I get an error 'The response is not in a JSON format'

Screenshot 2021-05-16 at 07.59.41.pngScreenshot 2021-05-16 at 08.00.06.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @mtagliaferri 

 

Thank you for your attempts.

 

After checking your screenshot, I found the configuration in 'compose2' may have some problem. We need to use output from compose inside.

 

Here is the detailed example for your reference:

My list to store user account:

v-duann-msft_1-1621327890139.png

 

My folder to store user photo:

v-duann-msft_0-1621327872614.png

 

The flow should be:

outputs('Compose')
replace(outputs('Compose_2'),'/','%2F')

v-duann-msft_2-1621328034557.png

 

Once tested, I'm able to remove according photos and get successful result.

v-duann-msft_3-1621328088016.png

 

Hope it helps

 

Best regards,

Anna

View solution in original post

4 REPLIES 4
v-duann-msft
Community Support
Community Support

Hi @mtagliaferri 

 

Thank you for posting.

 

According to your description, you would like to delete file for dynamic files but currently got file not found error.

 

Because when delete file will send an HTTP request to SharePoint, so the Identifier of the file should encode to URL format, so you should replace these "/" to "%2F". So you could use the replace() function to process the file path, for example:

v-duann-msft_0-1621218528555.png

 

Hope the content above may help you.

 

Best regards,

Anna

mtagliaferri
Resolver I
Resolver I

Hi @v-duann-msft ,

Thanks for your reply, I presume the first compose is to get the name of the file, in my case is a Name Surname (from people picker and Display Name), when I enter the Crew Member (Display Name) it pulls in a Aplly Each

Screenshot 2021-05-18 at 08.58.16.png

I presume on Compose 2 of your example I had to replace Hub with my file path:

Screenshot 2021-05-18 at 09.01.53.png

Screenshot 2021-05-18 at 09.08.34.png

 

I receive the below error when trying to save the flow:

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Compose_2' at line '1 and column '16525' is invalid. Action 'Apply_to_each_2' must be a parent 'foreach' scope of action 'Compose_2' to be referenced by 'repeatItems' or 'items' functions.'.'.

 

 

Hi @mtagliaferri 

 

Thank you for your attempts.

 

After checking your screenshot, I found the configuration in 'compose2' may have some problem. We need to use output from compose inside.

 

Here is the detailed example for your reference:

My list to store user account:

v-duann-msft_1-1621327890139.png

 

My folder to store user photo:

v-duann-msft_0-1621327872614.png

 

The flow should be:

outputs('Compose')
replace(outputs('Compose_2'),'/','%2F')

v-duann-msft_2-1621328034557.png

 

Once tested, I'm able to remove according photos and get successful result.

v-duann-msft_3-1621328088016.png

 

Hope it helps

 

Best regards,

Anna

@v-duann-msftThanks for your help, problem solved 😊

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,811)