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 / Generating specific wo...
Power Automate
Unanswered

Generating specific word documents from a list with different variables in each document

(0) ShareShare
ReportReport
Posted on by 2

Hi,

 

Currently I have a solution to what I am trying to do, but it is quite clunky when it comes to adding or changing templates to my flow. I want to see if there's a cleaner way of doing what I've set up.

 

Currently I have a PowerApps that has a gallery that allows the user to select which document they want to generate. By selecting a document, my flow gets triggered, with PowerApps feeding information that will be used in the flow including the document name using a FlowName.Run() command.

 

e.g. 

 

FlowName.Run(
 ClientInfoGallery.Selected.CustomerID,
 ClientInfoGallery.Selected.FName,
 ClientInfoGallery.Selected.LName
)

 

 

The actual flow then uses a PowerApps connector where I manually type in each field name that will be passed through and then using a Switch I have a case for every single document we've got. This becomes a very tedious process each time we have a new document we'd like to generate or if we've added a new field to the document. With us now having 16 documents, the flow itself is very bloated with 16 cases running horizontally.

 

Is there a cleaner way to handle assigning which document gets generated and having the Rich Text Controls in the document be filled out by the associated variable fed from PowerApps?

 

Appreciate the help!

image.pngimage.png

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    @alexiuk ,

    Do all your documents utilise the same metadata just different content?

     

  • alexiuk Profile Picture
    2 on at

    Every document uses CustomerID, Fname, LName, Address1, Address2, City, State, and ZIP.

    Couple of documents use all of the above in addition to ApptDate and Location.

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    What I am trying to understand is why do you need the Switch case.

    Can you not provide the filename as a dynamic string based on what document the user has picked?

    You just need to ensure that the Document names in the Document templates library match the inputs provided by your app to the flow

    SudeepGhatakNZ_1-1687213736786.png

     

     

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 305 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 155 Most Valuable Professional

Last 30 days Overall leaderboard