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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to copy the the folder of the document to another using power automate

(0) ShareShare
ReportReport
Posted on by 154
1)An application should have a lookup for its parent application on the application table (on the same table).

2)Add Ribbon Button On Application. The document is visible only if the parent application contains data (when a user clicks on the button titled /document history/ and on lookup selects any record which has already been created, then copies the document and attaches it to the current record(only copy the document of the filer Property + Technical record this two.).

3)Call Power Automate -- > add documents from the parent application on click

4)Show form Notification  /Documents will be moved in the background. Please check after some time/.

5)Environment Variable to store Power Automate URL

(Note: I have a flow which is  to create a folder so i want when user selects the lookup which is application is created the copy that document to current on click of  button)
I have the same question (0)
  • Verified answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    You can add the following code to the custom button to call the flow.
    function onload(primaryControl){
        var formContext = primaryControl;
     
        // get current record guid.
        var GUID = formContext.data.entity.getId();
        GUID = GUID.slice(1,-1);
     
        const req = new XMLHttpRequest();
     
            // This URL comes from the connector in the flow / when an HTTP request is received / generated URL.
            var url = "<your URL>";
            req.open("POST",url,true);
            req.setRequestHeader("Accept","application/json");
            req.setRequestHeader("OData-MaxVersion","4.0");
            req.setRequestHeader("OData-Version","4.0");
            req.setRequestHeader("If-None-Match","null");
            req.setRequestHeader("Content-Type","application/json ");
            //Sends the GUID of the current record to the flow.
            var body=`{"GUID":"${GUID}"}`;
            req.send(body);
       
    }
     
    The Power Automate Flow is shown below.
     
    If the parent record does not exist, the flow is aborted.
     
    Gets the parent record and creates a folder for the current record.
    Expression: replace(triggerBody()?['GUID'], '-', '')
     
    Get the filer Property and Technical Audit folders of the parent record.
    Expression:toUpper(replace(outputs('Get_the_parent_application')?['body/crf6a_applicationid'], '-', ''))
     
    Copies files from the parent record's filer Property and Technical Audit folders to the current record's folder.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 75 Super User 2026 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#3
11manish Profile Picture

11manish 52

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans