Populating a Microsoft Word Template and converting it to PDF in the same Logic App

Jojos_IQ 26 Reputation points
2022-11-11T02:14:54.44+00:00

Hello :)

I have a Logic App that does the following when a new item is made in a specific SharePoint list:

  • Populate a Microsoft Word Template (located in a SP Library)
  • Create a file in a specified SP Library using the content generated from the previous step
  • Delay for 10 seconds
  • Convert Word Document to PDF - the file isn't selectable at this point because it technically hasn't been made yet so I point it to where the previously created file is going to be and use the same name, put .PDF at the end of it as well
  • I then try to make a new file in a SP library using the converted file in the previous step as the content - file extension as .PDF

The outcome is one word document that has been generated based on a template and an attempt at converting that same document into a PDF. It's actually just an empty file that shows as an extensionless file in the library. I would like this to be a PDF that when opened, it shows the same content as the Word file that was generated from the template.

How is the best way to achieve this? Because I am hitting my head against a wall at this :(

If you need more information, I am happy to provide it :)

Thank you!

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,557 questions
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,941 Reputation points Moderator
    2022-11-11T05:46:26.493+00:00

    @Jojos_IQ Thanks for reaching out. Have you troubleshot your workflow to find out whether your word file was created successfully? If your word file was created successfully then you can use the Convert Word Document to PDF to convert the word to document and the output will be PDF binary content. Now you can leverage the Create File action to create the file in your SharePoint location.

    **Workflow: **

    259300-image.png

    Word File:
    259289-image.png

    PDF File:
    259290-image.png

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.