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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow as Template for d...
Power Automate
Unanswered

Flow as Template for deployment

(0) ShareShare
ReportReport
Posted on by

How can we I attach flow workflow to all current document libraries I have in sites and sub sites.

We are creating sites and libraries using PowerShell, is there a way of attaching Flow to all the previously crated library and newly libraries that will be created trough automated proecss. 

 

Thanks

Categories:
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Akhan3655,

     

    How do you want to attach your flows to your SharePoint libraries?

    Do you want to copy your flows into a SharePoint library?

    Or want to integrate your flows into SharePoint libraries and start a flow from a SharePoint library?

     

    If you want to copy your flows into a SharePoint library, please take a try with the following workaround:

    • Add a proper trigger, here I use Flow Button trigger.
    • Add a "List My Flows" action, specify Environment.
    • Add a "Filter array" action, From set to output of "List My Flows" action, click "Edit in advanced mode", type the following formula:
    • @equals(formatDateTime(item()?['properties']?['createdTime'], 'MM/dd/yyyy'), utcNow('MM/dd/yyyy'))
      Add a "Apply to each", input parameter set to output of "Filter array" action.
    • Within "Apply to each", add a "Get Flow" action, specify Environment, Flow field set to Flow Name dynamic content of "Filter array" action. Then add a "Create file" action, File Name field set to Flow Name dynamic content of "Get Flow" action (added with .json extension), File Content field set to Flow Definition dynamic content of "Get Flow" action.

    Note: On my side, I copy these flows which are created in current time.

     

    Image reference:4.JPG

     

    5.JPG

    The flow works successfully as below:6.JPG

     

     

    If you want to integrate your flows into SharePoint libraries and start a flow from a SharePoint library, please check and see if the following article would help in your scenario:

    https://flow.microsoft.com/en-us/blog/flow-in-spo-document-libraries/

     

    Best regards,

    Kris

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard