web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Convert Word Document ...
Power Automate
Unanswered

Convert Word Document to PDF after Creating New File in SharePoint from Word Template

(0) ShareShare
ReportReport
Posted on by 31

Dear PowerAutomate Community,

 

I am trying to expand my Flow to Convert the filled Word File from the Word Template but I am unable to do this and I'm getting error.

 

After creating the word file, I added an action to convert the newly created word file to PDF using the Output "Name" from earlier step using the Convert Word Document to PDF then create a new file as PDF (As shown in Screenshot#1). However, I am getting the below error as shown in Screenshot#2. 

 

Screenshot#1

Capture#1.JPG

 

As you can see in Screenshot#2 the word file has been created but the PDF I'm getting the error, I would like to have both copy of the PDF and Word File in the same location, I have the variable for the dynamic file path, I also added a delay of about 30 seconds after the word file is created in SP Library but still getting the same error.

 

Screnshot#2

Capture#2.JPGimg-13.jpg

 

In addition to above, I have tried to do another Flow which being deployed when a new file is created in SP and this flow will then create a file in Business OneDrive then Convert the new Word file into PDF then delete the file once the PDF is created and saved in SP library (This Approach Works Perfectly!!), However, this approach have at least 20-50 seconds delay before the PDF file is created in the same SP Library Location. Is there anyway to make it in one Flow as to form part of Screenshot#2. 

 

Capture#3.JPG

 

Any help is greatly appreciated.

 

Thanks,

Edward

Categories:
I have the same question (0)
  • Verified answer
    GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    Hi @Mielkew27 

     

    I made a test on my site and it seems that the connector Convert Word Document to PDF seems to be a bit special for its input parameter. 

     

    It seems like the connector is not accepting the internal Library name / path, it needs the DisplayName or selecting the proper Document Library in the drop down. I was not able to find the libraries display name in an Output from an action before. 

     

    Try selecting the library in the drop down.

     

    For the Filename, I was also not able to find a proper value from an action before which is working as variable. I created an own variable and modified the Full Path. What we need here is the Path (Without Library), therefore you can work with Split() expression and Split with '/'. In the Convert Action you can use concat() and add at the end the "File Name with extension". This worked for me. 

     

    Maybe someone else have a better solution how to solve this better / more dynamically. 

     

    Screenshot 2022-04-25 at 10.26.08.png

     

  • Mielkew27 Profile Picture
    31 on at

    Hi @GeorgiosG  I will try to digest and try the solution that you have provided. I have done the OneDrive approach and currently firing this approach perfectly however, since my trigger is from PowerApp which is directly populating a word template then creating a file in SP library, the PDF file generation takes about 20-40 seconds delay.

     

    Anyway, Thank you so much for your help. I hope I can follow and make the solution you provided.🤞

  • kashif21 Profile Picture
    4 on at

    Hi,

     

     you can simply use the file name of the newly created file.

    as shown in the blow screenshot.

     

    kashif21_0-1672225181974.png

     

     

  • Verified answer
    schwibach Profile Picture
    2 Moderator on at

    This only works with OneDrive as a data source. With SharePoint it seems a bit more special.

    I solve my workflows by using OneDrive for business to convert the documents and then save in SharePoint.

  • deakowen1 Profile Picture
    10 on at

    I have also run into this problem and it looks to me as if the Convert Word to PDF action does not support Environment Variables/non Hardcoded libraries for the Document Library.  This becomes a manual step for those of us that need to promote to PRD.

     

    HEY MICROSOFT!  Fix the issue with the action!!

  • Mielkew27 Profile Picture
    31 on at

    @deakowen1 I ended up using a switch since I had only a few Word template forms that I needed to fill out and convert to PDF format. Works for me! 

     

  • Ultimo Profile Picture
    16 on at

    Scusate ragazzi qualcuno potrebbe dirmi che tipo di colonna inserire in sharepoint per riportare un test di gradimento eventualmente in word, logicamente inserire il tutto nel flusso? 

    Cioè io ho un sondaggio nel form e vorrei riportarlo nel documento word solo che non capisco che tipo di colonna aggiungere in sharepoint.

  • Verified answer
    Dubya-eye-el-el Profile Picture
    58 on at

    @GeorgiosG , for the file name I simply used an expression in 'sharepointlibrary/documentfolder' and then added the dynamic content of the file name from after. This seemed to work fine for me.

    Dubyaeyeelel_0-1712599059175.png

     

  • lchap Profile Picture
    16 on at

    Hi I tried your solution and in the initialize variable I'm getting the error:  The input parameter(s) of action 'Initialize_variable' contain an invalid reference to 'Get_file_poperties'. Correct to include a valid reference to 'Get_file_poperties' for the input parameter(s) of action 'Initialize_variable'.

     

    This is what I have for Initialize varialbe: 

    split(outputs('Get_file_poperties')?['body/{Path}'],'/')
     
    Please advise

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard