Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to copy the Subgrid records from a Subgrid of one entity to another entity

(0) ShareShare
ReportReport
Posted on by

Dear All,

I am looking for an advise how to copy subgrid records from one entity to another. Here is my requirement

Entity 1 - Quote

Entity 2 - Order

Subgrid Entity - Insurance

Both Quote and Order entity has 1:N relationship with Insurance entity. Also I have added Insurance subgrid view in both Quote and Order Forms. 

So when users add Insurance in the Quote form and when they create Order from quote then I am looking for same set of Insurance records to be available in the Order entity as well. 

I am not a developer, is there anyway to achieve this using Customization, Power Automate Flow or JavaScript?

Thanks

Gowtham

  • Gowtham89 Profile Picture
    on at
    RE: How to copy the Subgrid records from a Subgrid of one entity to another entity

    Hi Joergen,

    Thanks Joergen for the detailed solution. I just got a chance to check and test this at my end.

    It works perfectly fine as per my requirement. Thanks again!!

    Thanks

    Gowtham

  • Verified answer
    Joergen Profile Picture
    455 on at
    RE: How to copy the Subgrid records from a Subgrid of one entity to another entity

    Hi Gowtham,

    if you compare your step with the step in the screenshot above in my post - in step 2: List ….

    I am using the following expression to filter the rows:

    pod_Quote/quoteid eq Quote(Value)

    please try

    mntr_quote/quoteid es Quote(Value)


    Otherwise, you can always build a view for insurances, where you filter insurances by related quote

    pastedimage1647465749990v2.png

    then you can use e.g. XrmToolBox and the FetchXMLBuilder Tool to identify the Filter query (instead of the GUID of the selected record use the Quote(Value) in Power Automate)
    pastedimage1647466066808v3.png

    Or, if you don't want to use XRMToolbox, you can use Advanced Find in D365 CE to get the FetchXML of the View

    pastedimage1647466814491v4.png

    and use the FetchXML in the Cloud Flow
    pastedimage1647466893515v5.png

    Best regards,
    Joergen

  • Suggested answer
    Manoj Mane Profile Picture
    1,012 on at
    RE: How to copy the Subgrid records from a Subgrid of one entity to another entity

    Hi Gowtham89,

    Please update your filter query with of list connector.

    "entityid_field" eq Retrieved_GUID_value from the previous step. 

    please refer the below screenshot for better understanding.

    pastedimage1647458970454v1.png

    pastedimage1647459058199v2.png

    Thanks,
    Manoj.

    Please mark this as VERIFIED if it helps.

  • Gowtham89 Profile Picture
    on at
    RE: How to copy the Subgrid records from a Subgrid of one entity to another entity

    Hi Joergen,

    Thank you so much for the detailed response.

    I created Power Automate flow as per the advise and its failing at list rows option. Not sure what is the issue with the field. Please find the screenshots for reference.

    pastedimage1647441362265v1.png

    Its failing at List rows step.

    pastedimage1647441431497v2.png

    Can you kindly check and advise where I am going wrong.

    pastedimage1647441664042v3.png

    Thanks 

    Gowtham

  • Suggested answer
    Joergen Profile Picture
    455 on at
    RE: How to copy the Subgrid records from a Subgrid of one entity to another entity

    Hi Gowtham,

    sure, you can achieve this with a Power Automate flow. But first making sure, that I understand your requirement correct, because your description does not match in my opinion the "Entity 1 , Entity 2.."

    What I understood from your description is, that you have Entity Insurance. Besides the Insurance specific values, there is 1 Lookup for Quote and 1 Lookup for Order on the Insurance.

    pastedimage1646947805345v1.png

    Insurance n:1 Quote

    Insurance n:1 Order

    Prerequisite: Build your Power Automate flow inside a solution 

    pastedimage1646948183721v2.png

    Step 1 - Identify the trigger:

    Use an automated flow with Dataverse trigger "When a row is added…" and select create

    pastedimage1646948259069v3.png

    Configure the trigger, that it will only run, when an order is created.

    pastedimage1646951375564v1.png

    In addition, you can further specify the trigger, that it will only run, when the order is created by a quote and not directly - this will reduce the flow runs. Click on the ... and select settings.

    Add a Trigger and enter the Trigger condition. If you do not know the name that must be entered, have a look at the next compose step below:

    pastedimage1646951458661v2.png

    To get the information needed for the trigger, you can easily add a new step to the flow of type Compose and select the Quote from the 1st step. Then click on the … and "Peek code)

    pastedimage1646949017367v6.png

    pastedimage1646949030399v7.png

    Then you can copy the code and add the necessary check: "@not(empty(triggerOutputs()?['body/_quoteid_value']))"

    Now you can delete the compose step, as it was only helpful to identify the trigger.

    Step 2: List all Insurance records related to the originating quote

    pastedimage1646950465212v9.png

    As my publisher is called pod, I have to filter the insurance table for all records where the column pod_quote contains the original quote id

    pastedimage1646950654199v10.png

    Step 3: Update the Insurance records

    Add the final Dataverse action: Update a row and select Insurance from the previous "List all insurances" step

    Once the value is entered into the update action, Power Automate will automatically generate an apply to each, as the reuslt of the provious step can be multiple records

    pastedimage1646950745540v11.png

    pastedimage1646950894752v12.png

    Now you need to specify which order should be related in the Order Lookup. Entering only the value of the first step in the flow will not be sufficient. You need to add salesorders/ before you select the Order from the first step.

    And that is already the solution. Save the flow and test it by adding insurance records to the quote and by activating the quote and close as won, the order will be created with the same insurance records attached.

    Please mark this answer as verified, when it was helpful for you.


    Best regards,

    Joergen

     

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans