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 Apps / Power Automate: parent...
Power Apps
Unanswered

Power Automate: parent and child flows on SharePoint libraries and documents (not lists)

(0) ShareShare
ReportReport
Posted on by 2

I have a complex SharePoint document approval online flow that I am going to have to implement in many different sites.

Copying and pasting it to each site is unmanageable in terms of cost and maintenance. For a start, the SharePoint trigger "For a selected file" and the "Get file properties" action are very specific to ONE site and ONE library.

The right way to do this is with a solution within which you include:

  • n very simple parent flows (just collect the credentials of the library and site from which the call is made).
  • 1 child stream with the complete stream receiving the credentials from one of the parent streams.

I've seen something very similar to what I'm aiming for in this great DamoBird video.

But there you manage lists and not libraries. And it doesn't work with libraries.

To start with, I need to obtain and transfer from parent to child flow two very specific things: the URL of the site and the reference of the library (with a GUID like a list?).

For the first I have used many combinations of expressions. So, if the site address is something like "https://fcces.sharepoint.com/sites/HUB", I've tried:

first(split(split(body('Get_file_metadata')?['{Link}'],concat('/',body('Get_file_metadata')?['{FullPath}'])))))
Which output is:
https://fcces.sharepoint.com/sites/HUB/Shared%20Documents/20230907%20prueba%20def/Doc%20de%20prueba_validado.pdf

first(split(split(body('Get_file_metadata')?['{Link}'],concat('/',body('Get_file_metadata')?['{Path}']))))))
Which output is:
https://fcces.sharepoint.com/sites/HUB/Shared%20Documents/20230907%20prueba%20def/Doc%20de%20prueba_validado.pdf

first(split(split(body('Get_file_metadata')?['{Link}'],concat('/',encodeUriComponent(body('Get_file_metadata')?['{Path}']))))
Which output is:
https://fcces.sharepoint.com/sites/HUB/Shared%20Documents/20231018%20Pruebas/Documento%20prueba%201.pdf

The truth is that I haven't been able to do something as simple as getting the URL of the parent flow and passing it to the child.
And I haven't yet been able to try to get some unique identifier of the library the file is in to pass it to the child as well.

Anyone out there who is working with parent-child flows at the library and file level (and not in lists)?

Many thanks in advance

 

 

Categories:
I have the same question (0)
  • rafagarcia Profile Picture
    2 on at

    Thanks to @DamoBird365  I have now been able to get the URL of the site from which the parent flow is launched. It's as simple as...
    20231123_IMG 20 48 55.jpg

    1. the Spanish For a selected file)
    2. the Compose action with: join(take(split(triggerBody()?['entity']?['itemUrl'],'/'),5),'/')

    @DamoBird365  has also helped me doing some research on how to pass the file reference. But I still need to somehow pass the reference to the library itself. Because in my large child flow I use, among others, the SharePoint action Update file properties. And there, yes or yes, you have to indicate the library.

    In addition, thanks to @cloudfronts and his video Single On-demand Power Automate Approval Flow for all SharePoint Document Libraries I have learned that library reference is more complex and ambiguous than that of the lists.


    He achieves a kind of solution, but I aim for the parent flow to be very, very simple and light. And this one is not.

    Another approach would be using environment variables (site and libraries). But... You know... When you manage a bunch of sites and libraries... It does sound not clean nor efficient mantaining so many variables.

    I am somewhat surprised because it seems to me that the question I raise is quite logical and potentially useful for many companies. But I have not yet found the solution. And any help would be welcome.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard