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

Imported PDF files in sharepoint are no longer PDF

So basically the flow is supposed to give users the ability to upload PDF files to sharepoint.

 

The only issue is that once the file is created in sharepoint, its no longer a pdf. It has no extension whatsoever actually. (you can still open it if you download and then choose a PDF reader but it defeats the whole flow purpose)

 

Is there any solution to this where the file remains in a PDF format once created in sharepoint? 

 

_0-1646691690746.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @改善 

Are your uploaded file always pdf file? If yes, you can add ‘.pdf’ directly to the end of the File Name field.

vLilyWmsft_0-1646876216578.png

If you also need to upload other types of files and want to change the name of the files, you can get the file extension according to the below formula , and then put the extension at the end of the File Name field.

last(split(triggerBody()['file']['name'],'.'))

vLilyWmsft_2-1646876689516.png

vLilyWmsft_3-1646876816859.png

Hope the content above may help you.

Best Regards

If my reply helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-LilyW-msft
Community Support
Community Support

Hi @改善 

You can take a try to use the following formula to get the filename with extension, then use the filename to create new file.

triggerBody()['file']['name']

vLilyWmsft_0-1646818126564.png

After flow runs, a new file with extension will be created.

vLilyWmsft_1-1646818228522.png

vLilyWmsft_2-1646818264847.png

Hope the content above may help you.

Best Regards

If my reply helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lily! this works and creates a PDF indeed.

 

So the triggerbody syntax is used to fetch attributes from the file and then use that as the name ? Is my thinking correct?

 

How could i change it so that the file keeps the PDF extension, but its renamed to the attributes pre-selected before?

 

_0-1646820713718.png

Before changing the file name to the triggerbody expression i had used the dynamic content options and that was giving my file the desired name.

_2-1646820947603.png

 

would you know how could i make it so that the file name is renamed according to the pre-inputs in the trigger step but still keep its PDF extension?

 

Hi @改善 

Are your uploaded file always pdf file? If yes, you can add ‘.pdf’ directly to the end of the File Name field.

vLilyWmsft_0-1646876216578.png

If you also need to upload other types of files and want to change the name of the files, you can get the file extension according to the below formula , and then put the extension at the end of the File Name field.

last(split(triggerBody()['file']['name'],'.'))

vLilyWmsft_2-1646876689516.png

vLilyWmsft_3-1646876816859.png

Hope the content above may help you.

Best Regards

If my reply helps, then please consider Accept it as the solution to help the other members find it more quickly.

Brilliant Lily! Thank you that works perfectly.

 

Mind if i pick your brain on another thing?

Currently the data from the "Period" selection menu is listed between parenthesis and underscores, is it due to being multi-select list? any idea how i could pull this out of the brackets/underscores and have it be displayed plainly?

_0-1646948309993.png

This is the input step:

_1-1646948393859.png

thanks!

 

Hi @改善 

Please try to use join() function.

vLilyWmsft_0-1646961946492.png

After flow runs, Period values will be linked by '_' like below:

vLilyWmsft_1-1646962175272.png

If you want to use other symbols to link multiple values, just change the '_' in the formula to the symbol you want.

Best Regards.

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,661)