---
title: "Create SignNow Embedded Invite"
url: "https://docs.signnow.com/docs/apex-create-embedded-invite"
type: "page"
section: "Integrations"
slug: "apex-create-embedded-invite"
---

# Create SignNow Embedded Invite

# Apex action: Create SignNow Embedded 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 **Create SignNow Embedded Invite** action allows users to create an embedded document group invite. To share an embedded invite with recipients, Salesforce users need to get a link to the invite using the **Get SignNow Embedded Signing Session URL** action.

In this example, we will configure a **Screen Flow** that creates an embedded invite and displays the link on the screen from any Opportunity record.

## 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: Create document variables

Create two variables for the document: one for the single item and one for the collection.

### Create the document item

- Click the **Toolbox** icon (top-left).
- Click **New Resource** and create a **Variable**.
- **API Name:** `Document_info`
- **Data Type:** Apex-defined
- **Apex Class:** `cuda_SNAPI_InviteDocument`
- Click **Done**.

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

### Create the document collection

- Click **New Resource** and create a **Variable**.
- **API Name:** `Documents_collection`
- **Data Type:** Apex-defined
- **Apex Class:** `cuda_SNAPI_InviteDocument`
- **Check:** **Allow multiple values (Collection)**.
- Click **Done**.

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

## Step 2: Create signer variables

Now, create the signer item and signers collection.

### Create the signer item

- Click **New Resource** and create a **Variable**.
- **API Name:** `Signer_info`
- **Data Type:** Apex-defined
- **Apex Class:** `cuda_signnow__SNAPI_Signer`
- Click **Done**.

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

### Create the signers collection

- Click **New Resource** and create a **Variable**.
- **API Name:** `Signers_collection`
- **Data Type:** Apex-defined
- **Apex Class:** `cuda_signnow__SNAPI_Signer`
- **Check:** ☑ **Allow multiple values (Collection)**.
- Click **Done**.

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

## Step 3: Create invite variables

### Create the invite item

- Click **New Resource** and create a **Variable**.
- **API Name:** `Invite_info`
- **Data Type:** Apex-defined
- **Apex Class:** `cuda_SNAPI_EmbeddedInvite`
- Click **Done**.

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

### Create the invites collection

- Click **New Resource** and create a **Variable**.
- **API Name:** `Invites_collection`
- **Data Type:** Apex-defined
- **Apex Class:** `cuda_SNAPI_EmbeddedInvite`
- **Check:** ☑ **Allow multiple values (Collection)**.
- Click **Done**.

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

## Step 4: Assignments for document data

Now you can fill in document information and add it to the documents collection.

Return to the flow scheme and click the + icon below the **Screen Flow.**

- Add an **Assignment** element.
- **Add a label:** `Fill document information`.
- **Set Variable Values:**
    - `Document_info.id` **Equals** `[document_ID]`
        
        **Note**: This is the ID of the specific file inside the group, NOT the group ID. You can add it manually or add a resource.
        
    - `Document_info.role` **Equals** `Recipient 1`
        
        **Note**: This is case sensitive. It must match your SignNow document role exactly.
        
    - `Document_info.action` **Equals** `sign`
        
        **Note**: This MUST be lowercase `sign`.
        

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


### Add document information to the collection

- Click the **+** icon below to add a second **Assignment** element.
- **Add a label:** `Add document information to collection`.
- **Set Variable Values:**
    - **Variable:** `Documents_collection`
    - **Operator:** Add
    - **Value:** `Document_info`

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

## Step 5: Assignments for signer data

Fill in the signer's information and add it to the signers collection.

### Fill signer information

- Click the **+** icon to add an **Assignment** element.
- **Add a label:** `Fill signer information`.
- **Set variable values:**

 For this flow, use the email, first name, and last name of the user who runs the flow (`running user`).

- `Signer_info.email` **Equals** `Running User > Email`
- `Signer_info.first_name` **Equals** `Running User > FirstName`
- `Signer_info.last_name` **Equals** `Running User > LastName`
- `Signer_info.documents` **Equals** `Documents_collection`

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

### Add signer information to the collection

- Click the **+** icon to add an **Assignment** element.
- **Add a label:** `Add signer information to collection`.
- **Set variable values:**
    - **Variable:** `Signers_collection`
    - **Operator:** Add
    - **Value:** `Signer_info`

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


## Step 6: Assignments for invite data

Fill the invite data and add it to the invites collection.

### Fill invite information

- Click the **+** icon to add an **Assignment** element.
- **Add a label:** `Fill invite`.
- **Set variable values:**
    - `Invite_info.signers` **Equals** `Signers_collection`
    - `Invite_info.order` **Equals** `1`

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

### Add invite info to the invites collection

- Click the **+** icon to add an **Assignment** element.
- **Add a label:** `Add invite info to invites collection`.
- **Set Variable Values:**
    - **Variable:** `Invites_collection`
    - **Operator:** Add
    - **Value:** `Invite_info`

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

## Step 7: Configure the SignNow actions

### Action 1: Create the SignNow embedded invite

- Click the **+** icon and select **Action**.
- Search for and select **Create SignNow Embedded Invite**.
- **Set Input Values:**
    - **SignNow Document Group ID**: `Document group ID` (enter manually or add a resource)
    - **SignNow Embedded Invites**: `Invites_collection`

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

### Action 2. Get SignNow embedded signing session URL

- Click the **(+)** icon and select **Action**.
- Search for **Get SignNow Embedded Signing Session URL**.
- Add a label: `Get SignNow Embedded Signing Session URL`
- **Set Input Values:**
    - **Email:** `Running User > Email`
    - **SignNow Document ID**: `Document group ID` (enter manually or add a resource). **Note:** The document group ID should be the same as in the **Create SignNow Embedded Invite** action input.
    
    - **SignNow Embedded Invite ID**: `Outputs from Create SignNow Embedded Invite > SignNow Embedded Invite ID`.

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

## Step 8: Display the link (screen)

Add a screen element to show the embedded invite link from the Opportunity.

- Click the **(+)** icon and select **Screen**.
- **Add a label:** `Get embedded URL`.
- In the **Components** panel on the left, select **URL**.
- **Add an API name**: `Embedded_signing_URL`
- **Add a value resource**: `Outputs from Get_SignNow_Embedded_Signing_Session_URL > SignNow Embedded Signing Session URL`
- Click **Done**.

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

## Step 9: Finalize the flow

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

## Step 10. Create a flow action and add it to the Opportunity layout

Now, [create an action](/docs/add-action-page-layout) that will show the screen with the embedded invite URL on the Opportunity. 

## Result
Users can now click the **Get embedded invite link** button on any Opportunity to generate and view the signing link. The signing link can be embedded in an iframe using a Lightning Web Component (LWC) that wraps the standard HTML `<iframe>` tag.

---

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


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