---
title: "Reassign SignNow Invite"
url: "https://docs.signnow.com/docs/apex-reassign-invite"
type: "page"
section: "Integrations"
slug: "apex-reassign-invite"
---

# Reassign SignNow Invite

# Apex action: Reassign SignNow Invite

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

The **Reassign SignNow Invite** action allows users to reassign a document group signature invite to a different email address.

In this example, we will create a Screen Flow where a user can view document details, change the signer's email, and send the document group to the new email address. We will also retrieve the document group data needed to perform this reassignment.

## 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.

> This action retrieves data required for reassignment.

- 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. 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. 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 inside the loop path (**For Each**) 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. 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 below 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 inside the second loop path (**For Each**) 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

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


**Add a Text component (Input) for the user to specify the email to replace:**

- In the Components panel on the left, select **Text**.
- Add a label: `Old email`.
- Click **Done** to save the screen.

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

## Step 5. Add new variables

Create variables to store the invite ID, step ID, and old email to pass them to the **reassign** action later.

### **Create the Invite ID variable**

- Click **New Resource** in the Toolbox.
- **Resource Type**: Variable
- **API Name:** `Invite_id`
- **Data Type:** Text
- Click **Done** to save.

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

### **Create the Step ID variable**

- Click **New Resource** in the Toolbox.
- **Resource Type**: Variable
- **API Name:** `Step_id`
- **Data Type:** Text
- Click **Done** to save.

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

### **Create the old email variable**

Create a variable to hold the email address that needs to be replaced.

- Click **New Resource** in the Toolbox.
- **Resource Type**: Variable
- **API Name:** `Old_email_to_replace`
- **Data Type:** Text
- Click **Done** to save.

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

## Step 6. Add assignments

### Assignment 1

Store the IDs from the **Get SignNow Document Group** action into your new variables.

- Click the **+** icon below the `Main information screen` .
- Select **Assignment**.
- Add a label: `Fill reassign info`.
- **Set variable values:**
    - `Invite_id` **Equals** `Outputs from Get SignNow Document Group Action` > `last_invite_id`.
    - Click **Add Assignment**.
    - `Step_id` **Equals** `Outputs from Get SignNow Document Group Action` > `pending_step_id`.

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

### Assignment 2

Capture the email from the current loop item and store it in the old email variable.

- Click the **+** icon below the **Each field** screen**.**
- Select **Assignment**.
- Add a label: `Put email to variable`.
- **Set variable values:**
    - `Old_email_to_replace` **Equals** `Current Item from Loop Go through Fields > signer_email`

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

## Step 7. Add Reassign SignNow Invite action

Click the **+** icon above the end of the flow (outside the loops).

- Add the **Reassign SignNow Invite** action to the flow.
- Add a label: `Reassign SignNow Invite`.
- Set input values:
    - **Enter a new recipient email:** Enter the new email address (e.g., a static value or a resource).
    - **Enter an old email:** Select the `Old_email_to_replace` variable.
    - **Document Group ID:** Select `Outputs from Get_SignNow_Document_Group > document_group_id`.
    - **SignNow Invite ID:** Select the `Invite_id` variable.
    - **SignNow Step ID:** Select the `Step_id` variable.

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

## Finalize

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

## Result

- Once the flow runs, all requested information about the document group is displayed.
- A user enters the email address that should be replaced in the **Old email** text field.
- Once the email address is added, the signature invite is sent to the new email address defined in the flow.

---

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


---
*Full page: https://docs.signnow.com/docs/apex-reassign-invite*
