---
title: "Get SignNow Document Group"
url: "https://docs.signnow.com/docs/apex-get-document-group"
type: "page"
section: "Integrations"
slug: "apex-get-document-group"
---

# Get SignNow Document Group

# Apex action: Get SignNow Document Group

> Before configuring this Apex action, review the [prerequisites](/docs/salesforce-apex-actions#prerequisites) for SignNow Apex actions and complete the required setup steps.

The **Get SignNow Document Group** action retrieves detailed information about a specific document group (such as IDs, status, and documents), which can then be used in downstream automation or displayed to the user.

In this example, we will configure a **Screen Flow** that retrieves and displays this information.

## Prerequisites

- Go to **Setup** > **Flows** > **New Flow.**
- Select **Screen Automations > Screen Flow**.

![get_dg_flow_type.png](/reference-assets/images/SignNow_Salesforce/apex_actions_2/get_dg_flow_type.png)

## Step 1. Add the **Get SignNow Document Group** action

- Click the **+** icon to add the **Get SignNow Document Group** action to the flow.
- Add a label: `Get SignNow Document Group`.
- **SignNow Document Group ID**: Add the ID or select a resource.
- **The output resources show the information that can be retrieved:**
    - List of documents
    - Document group ID
    - Invite ID
    - Document group name
    - Pending step ID
    - State

![get_dg_action_settings.png](/reference-assets/images/SignNow_Salesforce/apex_actions_2/get_dg_action_settings.png)

## Step 2 (Optional). Add a screen element

Add a screen to display the information about the document group.

- Click the **+** icon below the SignNow action and select **Screen**.
- Add a label: `Main information screen`.
- In the Components panel on the left, select **Display Text**.

![reassign_main_info_screen.png](/reference-assets/images/SignNow_Salesforce/apex_actions_2/reassign_main_info_screen.png)

- **Enter an API name:** `Doc_group_text`.
    - Note: API name can only contain underscores and alphanumeric characters.
- **In the Insert a resource field**, select the **`Outputs from Get_SignNow_Document_Group action`** > Select the data you want to display on the screen. For example, display the following data:
    - Document group ID.
    - Last invite ID.
    - Pending step ID.
- Click **Done** to save the screen.

![get_dg_main_info_text.png](/reference-assets/images/SignNow_Salesforce/apex_actions_2/get_dg_main_info_text.png)

## Step 3 (Optional). Add a loop element (1)

Add a loop element to iterate through the documents related to the document group and extract specific details.

Click the **+** icon below the screen element and select **Loop**.

- **Add a label:** Go through documents.
- **Select collection variable:** `Outputs from Get_SignNow_Document_Group Action` > `documents`.

![reassign_got_through_documents_loop.png](/reference-assets/images/SignNow_Salesforce/apex_actions_2/reassign_got_through_documents_loop.png)

### Add a screen inside the loop

- Click the **+** icon under **For Each** within the loop and select **Screen**.
- **Add a label:** `Each document screen`.
- In the **Components** panel on the left, select **Display Text**.
- **Enter an API name:** `Document_info`.
- In the **Insert a resource field**, select the `Current Item from Loop` > `Go through documents` and select the data you want to display on the screen. For example, display the following data:
    - Document ID
    - Roles
- Click **Done** to save the screen.

![get_dg_for_each_doc_screen.png](/reference-assets/images/SignNow_Salesforce/apex_actions_2/get_dg_for_each_doc_screen.png)


## Step 4 (Optional). Add a loop element (2)

Add a second loop element to iterate through the fields within the document group invite and extract specific details.

Click the **+** icon under the **Each document screen** and select **Loop**.

- **Add a label:** `Go through fields`.
- **Select collection variable:** `Current Item from Loop`  `Go through documents` > `field_invites`.

![reassign_go_through_fields_loop.png](/reference-assets/images/SignNow_Salesforce/apex_actions_2/reassign_go_through_fields_loop.png)

### Add a screen inside the nested loop

- Click the **+** icon under **For Each** within the second loop and select **Screen**.
- **Add a label:** `Each field screen`.
- In the Components panel on the left, select **Display Text**.
- **Enter an API name:** `Field_info`.
- In the **Insert a resource field**, select the `Current Item from Loop` `Go through fields` > and select the data you want to display on the screen. For example, display the following data:
    - Signer email
    - Status
- Click **Done** to save the screen.

![get_dg_for_each_field_screen.png](/reference-assets/images/SignNow_Salesforce/apex_actions_2/get_dg_for_each_field_screen.png)

## Step 5. Finalize the flow

- Click **Save**.
- **Activate** the flow.

## Result

Each time the flow runs, the requested information about the document group is displayed on the screen.

---

View the full list of [SignNow Apex actions](/docs/salesforce-apex-actions).


---
*Full page: https://docs.signnow.com/docs/apex-get-document-group*
