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 / Sending File Contents ...
Power Automate
Answered

Sending File Contents between Child/Parent Flow

(0) ShareShare
ReportReport
Posted on by

We are working to capture business process details (ie: file location, file naming convention, pdf conversion connector, etc) within a child flow so that we can more easily maintain this subprocess when something changes.

 

In the Parent Flow, we populate the desired word template: works.  Send the contents to the child flow: works which does it's magic and then returns the PDF contents back to the parent to do as it pleases (ie: email the attachment to someone).  Everything works fine except I cannot get the returned content to attach to an email nor can I get it to create a physical PDF file (which it can do in the child...just not the returned parent...see child flow).  It works perfect in Child...the Parent creates a 4 page PDF as expected BUT it is blank.

 

This is the Parent Flow

cangelodawg_0-1649265649849.png

 

This is the Child Flow - NOTE: The contents passed to the child allow me to create a physical pdf file with no issues.

 

I have tried returning the content as a file and as text (string).  

child.png

 

Any ideas 

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @Anonymous 

    On the child flow you need to return content and content-type separately as below and then reconstruct it on the parent

    Child, After the convert File:

    Mira_Ghaly_0-1649293525072.png

    Compose Expression:

    outputs('Convert_file')?['body']['$content']

    Compose 2 Expression:

    outputs('Convert_file')?['body']['$content-type']

     

    On the parent reconstruct the file content as below:

    Mira_Ghaly_1-1649293643520.png

     

    Compose - reconstruct the JSON object based on the outputs from the child

    {
     "$content-type": "@{body('Run_a_Child_Flow')?['content_type']}",
     "$content": "@{body('Run_a_Child_Flow')?['content']}"
    }

     

    This worked for me creating the file on the parent , Hope this helps!

     

     

  • Community Power Platform Member Profile Picture
    on at

    1 more thing

     

    That works!  Thank you, however, if I try to put the Compose block that "reconstructs the file" as an object with content and content-type into the Child (instead of reconstructing in the parent) and then return that Compose as a text parameter to the parent...it jumbles up into a mess of ascii type characters (like below).  Any idea why it's changing it from 

    cangelodawg_0-1649347353069.png

     

  • Community Power Platform Member Profile Picture
    on at

    This is the update putting it in the file and returning to the parent.  The  individual Composes work great and allow the parent to reconstruct it just like here...BUT if reconstructed in the child and passed back to parent like this, It gets jumbled (portion shown in screenshot above) childUpdate.png

  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @Anonymous 

    Yes I have the same that is why you need to re-construct in the parent and this is mainly because of the way variable are passed so by somemeans when you add the compose object to a string it tries to convert it to this strange output, so to keep it working you need to pass separately from child and reconstruct in parent.

     

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    I just wanted to post an update.  I FINALLY figured out a way to do it so that I don't have to create extra steps in the parent after it calls the child process.  Instead of passing Compose (temp) variables back, I send an object variable.  I initialized an object variable called pdfFile and then set the object up using the Compose variables.  This works and makes for easier parent usage 

     

    cangelodawg_0-1654111123824.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…

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard