
Expanding Power Automate Series: Extract and update DocGen form fields with low-code expressions
Docusign for Power Automate helps you automate complex agreements, but retrieving Document Generation field data can be complex. See how to use low-code expressions and array indexing to correctly extract specific field names from JSON arrays and successfully update their values before sending the envelope.

When building automated workflows that require dynamic document customization in Power Automate, developers often need to update specific Document Generation (DocGen) fields that aren’t available until the flow begins. While the Docusign for Power Automate connector is highly accessible for low-code users, certain advanced actions, like retrieving document generation (DocGen) fields, can sometimes present a challenge by returning data in a JSON array.
This post is for technical users and developers who want to harness the full power of the Get document generation form fields from envelope action. We will use Power Automate's expression editor and array indexing to directly target specific fields from the output, allowing you to update them without requiring complex JSON parsing or looping actions.
The challenge: a list of fields is returned as an array
When using the Get document generation form fields from envelope action, the output is not a simple list of tab names but a structured JSON array. While this array contains valuable data (name, type, document ID, etc.), consuming it requires understanding how to target specific array elements.
When the Get document generation form fields from envelope action executes, it returns a JSON object containing the docgenFields array. For example:
"body": {
"docgenFields": [
{
"name": "Stock_allocation",
"type": "TableRow",
"label": "Stock_allocation",
"documentId": "0deb018e-xxxx-xxxx-xxxx-f9ce50e4790a"
},
{
"name": "RSU",
"type": "TextBox",
"label": "RSU"
},
{
"name": "Company_Awards",
"type": "TextBox",
"label": "Company_Awards"
},
{
"name": "Performance_Awards",
"type": "TextBox",
"label": "Performance_Awards"
},
{
"name": "Dividends",
"type": "TextBox",
"label": "Dividends"
},
{
"name": "Bonus",
"type": "TextBox",
"label": "Bonus"
}
]If you try to map the output directly to the next action, the flow will fail because it expects a single field name, not an entire array of objects.
The low-code solution: direct array indexing
To overcome this, we use the Power Automate expression editor to build a pointer that targets the exact object we need. This relies on zero-based array indexing, where the first item is index [0], the second is [1], and so on.
A low-code solution in Power Automate is to use the outputs() expression coupled with array indexing. This allows you to directly target the exact element you need based on its position in the list.
To retrieve the name of the Company_Awards field (which is at index [2]), you can use the following expression:
outputs('Get_document_generation_form_fields_from_envelope')?['body']?['docgenFields'][2]['name']
This returns the simple string value: "Company_Awards".
Implementing the solution in your flow
The example flow below demonstrates the minimum required actions to correctly retrieve a specific field name using array indexing and then update it before sending. Let’s walk through it together.

Create a new Instant cloud flow. In Power Automate, select New Flow > Instant cloud flow.

Add Trigger. Name your flow, select Manually trigger a flow, and then click Create.

Add Step: Create envelope using template with recipients and tabs. Select your account and template, specify the recipient, and add email text.

Add Step: Get document info from envelope. Select the Account ID and Envelope ID (created in Step 3) and provide the exact Document Name (filename) from your eSignature template.

Next, we have to get the document generation fields. Add Step: Get document generation form fields from envelope. Select the Account ID and Envelope ID (created in Step 3). This action returns the array you need to parse.

Now we can update the form field using array indexing. Add Step: Update document generation form fields from envelope. Select the Account ID, Envelope ID (created in Step 3), and Document GUID (created in Step 4).

In Field Name, switch to the Expression (fx) view, and enter your array index formula.

In Field Value, enter the new data you want to merge into the document (for example, “Outstanding Performance Award”).
Add Step: Send envelope.

That’s it! Save and test the workflow.
Conclusion
The Get document generation form fields from envelope action introduces a common technical hurdle for Power Automate users by returning its data as a complex JSON array. This structure prevents no-code users from immediately mapping a field name to the necessary downstream action, such as the Update document generation form fields from envelope action.
By leveraging a simple, low-code technique—the combination of the outputs() expression and array indexing—you can bypass complex looping actions and JSON parsing. This method allows you to precisely extract the single field name required to update document values.
Ultimately, using direct array indexing unlocks the full potential of the DocGen action, ensuring your automated workflows are more efficient and easier to maintain. This approach empowers you to implement advanced customizations and integrate Docusign more powerfully into your broader application ecosystem.
This is part of the broader Expanding Power Automate content series. Stay tuned for more technical deep dives!
Additional resources
Natasha Mayor is a Technical Writer based in San Francisco who specializes in the Docusign for Power Automate integration. She is passionate about improving the overall user experience and ensuring customers can easily find the complex information they need to automate their workflows.
Related posts
Docusign IAM is the agreement platform your business needs



