cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtagliaferri
Helper III
Helper III

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
Helper III
Helper III

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

View solution in original post

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

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Users online (2,941)