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
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,983)