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 / SetWordTemplate - Unbo...
Power Automate
Answered

SetWordTemplate - Unbound action for multiple entities

(0) ShareShare
ReportReport
Posted on by 1,710

Hello,

I am following this amazing blog post by @LinnZawWin to generate document from word template using SetWordTemplate action.

The expected template to be generated is to see the Account "LAST WON Opportunity Actual Revenue". In this case, we have 1:N (Account to many Opportunities).

In the custom action, I have created three different Input parameters as Entity Reference as per the below screenshot:

Julien2_0-1687809813166.png

For each condition, I have set the parameters for the action SelectedTemplate and Target which is mainly the GUID of the record that will be retrieved from the flow.

 

When I started building my flow and attempting to save it I got the below error:

The dynamic schema response from API 'commondataserviceforapps' operation 'GetMetadataForUnboundActionInput' is too large, only schemas with at most '1024' properties are supported

Julien2_1-1687810216697.png

Clearly it is stating that we exceeded the limits of the fields because in the Accounts and the Opportunities we have MANY fields and currently I am stuck to find a workaround to be able to proceed with the testing.

 

In addition, I am doing the steps right meaning if I wan to fetch data from the child tables the EntityReference should be within the custom action?

 

Could you please advise what will be the most effective solution to resolve the above issue and achieve the requirements needed?

I will be adding @Mira_Ghaly since also she faced similar issue but with a different scenario.

Any help is greatly appreciated.

Thank you!

Categories:
I have the same question (0)
  • Linn Zaw Win Profile Picture
    2,996 on at

    @Julien2 

     

    You are supposed to populate only one EntityReference at a time to the custom SetWordTemplate action because the word template will be bound to one single entity (and its related entities via mapping). In your Word Template, the dynamic values for the Account will be populated as the N:1 parent field mapping of the provided Opportunity EntityReference.

     

    So, can you remove the Account object in your JSON and try again?

    LinnZawWin_0-1687816753333.png

     

     

  • EBMRay Profile Picture
    1,710 on at

    Hi @LinnZawWin ,

     

    Appreciate your support.

     

    My main concern is why do I have to remove the Account EntityReference since the Account is associated with the Opportunity, Quotes, etc.? Because lets say I am planning to fetch all the quotations (repeating table) associated with the opportunity based on the account. How I will end up with the custom action? Do I have to create another new custom action and add the quotation as the entityreference to generate the needed?

     

    Currently, I was able to filter and fetch the last opportunity but I am still stuck passing it to the wordTemplate as currently it is showing the wrong actual amount value because in the custom action I am mapping the account GUID.

     

    Below is a screenshot:

    Julien2_0-1687871451340.png

     

    Based on the above screenshot this account has two opportunities and the last actual value is 20K$ and in the template it is showing 23,131$ which is wrong.

    Julien2_1-1687871484342.pngJulien2_3-1687871583602.png

     

    It seems that it is not doable to do it from the parent entity and I have to create a custom action for each child table? Or do I need to extend the "Populate word as template" to achieve all my requirements?

     

    Awaiting your feedback.

    Best regards,
    Julien

  • Linn Zaw Win Profile Picture
    2,996 on at

    Hi @Julien2 

     

    Let's take a step back and try to generate the Word Template manually from the model-driven app to get the data that you want based on the requirement (before we start automating).

     

    If the requirement is to fetch all the quotations (repeating table) associated with the opportunity based on the account, the word template should be based on the Account entity. But the template will only be able to show the values from the 1:N child entities (Opportunity, Quotes, etc.) in a repeating content control (tabular format). When you automate that word template in the cloud flow, you need to pass the Account GUID.

     

    If the requirement is to show the information from the last opportunity and the account, the word template can be based on the Opportunity entity. The template will be able to show the values from that particular Opportunity, the value from the N:1 parent entities (Account, Originating Lead, etc.) in normal content control. When you automate that word template in the cloud flow, you need to pass the Opportunity GUID after querying the last one in the List Rows action and use the first() one.

     

    Based on the screenshot in your last comment, it seems like your word template is an Account-based word template and that content control is showing the values from the first Opportunity (because it is not in the repeating content control).

    When you call the SetWordTemplate action, you just passed the Account GUID. Then, the action would retrieve the data from that particular Account and ALL related data (even though you specified the top=1 with modifiedon desc in the FetchXML) to populate the word template.

    Please try to create an Opportunity-based word template and pass the GUID of the last Opportunity record and see how it goes.

     

     

  • EBMRay Profile Picture
    1,710 on at

    Hello @LinnZawWin ,

    Thank you so much for providing the details.

    I will provide my comments based on each point you mentioned:

     

    1. In regards to this one, it means that you cannot apply specific filters to only show for example the Quotation that are not in Draft State related to a specific account or opportunity. Because in the unbound action we are just passing the account GUID number and in the word template itself you cannot apply any filters unless you get back to the standard connector "Populate word as a template" and you build it as you want.


    2. I understand the second point means you create the template under the opportunity table and you can extract any necessary information from the account.

     

    Can you just give your input on handling the first point that I mentioned to filter the data needed? (Show me all the quotations not in Draft State related to a specific account)

     

    So in the unbound action you can achieve such a scenario or do we need to get back to the typical connector "Populate word as a template"?

     

    Best regards,

  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Julien2 

     

    From the screenshot you provided I can see you are passing the Account Id and if you still want to keep the input parameters that way I would create the dataset pre-hand before it hits the generations of word doc. This way you have all the data ready to map under the template. Its' an another thought.

     

    Thanks @LinnZawWin  for your awesome contributions.

     

    Thanks

  • Verified answer
    Linn Zaw Win Profile Picture
    2,996 on at

    @Julien2 

    1. For this requirement, this is more of a limitation of the Word Template in Dataverse rather than the Power Automate cloud flow problem. The cloud flow would just call the action and you can only achieve what you can achieve with generating a Word Template from the UI in the model-driven app. Since filtering of the related records is not available in the OOB Word Template in Dataverse, I am afraid you will have to get back to the typical connector "Populate word as a template" for such advanced scenarios.

     

    Please refer to @Mira_Ghaly's response in this thread.

    https://powerusers.microsoft.com/t5/Microsoft-Dataverse/word-templates-with-filtered-data/td-p/1536748

     

     

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard