Skip to main content
Question

Get all Completed documents by Power Automate


Forum|alt.badge.img+1

Hello everyone,

I'm experiencing an issue with an "Until" loop in my Power Automate workflow that isn't functioning as expected. The loop is supposed to continue running as long as the hasMoreResults property in the API response is set to true. Here are the details:

Workflow Configuration:

I'm using an "Until" loop with the condition @equals(body('Copilot:_List_envelopes_1')['hasMoreResults'],true).
The loop has a limit of a maximum of 60 iterations or a maximum runtime of 1 hour (PT1H).
API Response:

The API response includes the property "hasMoreResults": true, indicating that there are more results available.
The response consistently provides only 10 records or envelopes, which are processed correctly.
Problem:

Despite the hasMoreResults: true property, the loop ends after one iteration and does not retrieve additional results.
I've verified that the condition is correctly implemented and the API response is as expected.
What I've Tried:

Reviewing the loop logic and API response structure.
Ensuring that pagination parameters are correctly used, if required.
Checking logs and debugging information to identify any potential errors or exceptions.
I would greatly appreciate any help or insights on how to resolve this issue. Are there specific pagination parameters I should be using, or are there other known issues with the "Until" loop in Power Automate?

Thank you in advance!

 

Power Automate Workflow Description:

This Power Automate workflow is designed to periodically retrieve completed envelopes from DocuSign and store the associated documents in a SharePoint Online site. The workflow is triggered every 30 minutes and operates within the "W. Europe Standard Time" timezone.

Workflow Components:

Trigger:

Recurrence: The workflow is triggered every 30 minutes, ensuring regular checks for new completed envelopes in DocuSign.
Actions:

Until Loop:

Condition: The loop continues as long as the hasMoreResults property in the API response from DocuSign is true.
Limit: The loop is constrained to a maximum of 60 iterations or a runtime of 1 hour (PT1H).
Copilot:_List_envelopes_1:

Type: ApiConnection
Function: Retrieves a list of completed envelopes from DocuSign using the /accounts/copilotAccount/envelopes/listEnvelopes endpoint.
Parameters: Filters envelopes by status (completed) and a specified from_date.
For_each_1:

Type: Foreach
Function: Iterates over each envelope returned by the Copilot:_List_envelopes_1 action.
Actions within Foreach:
Get_documents_from_an_envelope:

Type: ApiConnection
Function: Fetches documents from each envelope using the DocuSign API.
Path: Constructs the API path dynamically using the envelope ID.
Create_file:

Type: ApiConnection
Function: Uploads the retrieved documents to a specified folder in SharePoint Online.
Path: Specifies the SharePoint site and folder path for document storage.
File Naming: Names the file using the envelope title and the date sent, formatted as a timestamp.
Connections:

DocuSign: Utilizes a managed API connection to interact with DocuSign services.
SharePoint Online: Uses a managed API connection to store documents in SharePoint.
Parameters:

$connections: Defines the connection details for DocuSign and SharePoint Online, including connection IDs and names.
Overall Flow:
The workflow periodically checks for completed envelopes in DocuSign, processes each envelope to retrieve associated documents, and stores these documents in a designated SharePoint Online folder. The loop ensures that all available envelopes are processed, leveraging the hasMoreResults property to determine if additional pages of results need to be fetched.

3 replies

Forum|alt.badge.img+8

Hello ​@FloSH45,

Thank you for reaching out, and welcome to the Docusign Community! We are thrilled to have you here and look forward to sharing as much knowledge as we can.

I understand that you are facing a problem with an “Until” loop in your Power Automate workflow that is not working as intended. I sincerely apologize for any inconvenience this may have caused. Please be assured that I will do my best to assist you.

I have consulted with our internal team, and they informed me that the Copilot: List envelope action should not be used within a workflow. However, we will be introducing a new List envelope action in our upcoming release, which is expected next month. For more details, please refer to the note on this page: Copilot: List envelopes

I hope this is helpful. Favor, if you found the response to be a useful solution to your question, please mark it as the best answer by clicking “Select as Best” to make it easier for other users to find. Let us know if you need further assistance with this. Thank you!

 

Best regards,

Melanie | Docusign Community Moderator

"Select as Best" below if you find the answer a valid solution to your issue.

 


Forum|alt.badge.img+1
  • Author
  • Newcomer
  • 1 reply
  • March 26, 2025

Hi ​@Melanie.Panguito, thank you for your response. Is there another way to copy all completed documents from a DocuSign account to SharePoint?

 

Best regards,

Florian


Forum|alt.badge.img+8

Hello ​@FloSH45,

The best option is to use the stand-alone product - Docusign Retrieve: Docusign Retrieve 4.3.0. For further discussions, you can reach out to the Sales team by visiting: Contact the Docusign Sales Team | We're Here to Help. If you are on an enhanced plan, your Administrator can either open a support case or contact the Account Team directly. To open a support case in the Docusign Support Center, go to the "Get Support" section and select "Open a Support Case.” Log in using your Docusign credentials and select a case subject. If you have multiple Docusign accounts, choose the appropriate account to continue. Open a case in the Docusign Support Center
Additionally, if you simply want to get copies of completed documents, you may export documents to a cloud storage device using our Connect feature (available to some plans), where you will configure your OneDrive/Box account and, later, republish all the envelopes you want to store.

Articles:
Create a Connect for OneDrive Configuration
Bulk Download via Box integration: One-Time or Consistent Publish
After you have fully completed the above configuration, you will access the Publish tab (still within Connect) 
Article: How to Perform a Manual Publish of Connect Data in Low or High Volumes

Note: Some advanced features and options are supported only in specific Docusign plans. Your account plan might not support some of the options discussed in this help topic. Contact your account administrator for more information about which options are available for your account. Or, visit our Plans and Pricing web page for more details on the features included with your plan. Compare eSignature plans & pricing.

I hope this is helpful. Favor, if you found my response to be a useful solution to your question, could you please click the "Best Answer ✅" button at the bottom of the post? It helps other community members who might have similar questions. Thank you!

 

Best regards,

Melanie | Docusign Community Moderator

"Select as Best" below if you find the answer a valid solution to your issue.