Screen Flows
- Navigate to Salesforce Setup > Process Automation > Flows.

- From the Flows page, click New Flow.

- Select Screen Flow, then click Create.

- To create the Flow, we first need to create a RecordID variable. To create a new variable, click the box in the top left corner.

-
Click on New Resources and select the Resource Type as Variable. Then set the Data Type as Text. For Availability Outside the Flow, check Available for input. Finally, click Done.
Please Note: the recordId variable is case and name sensitive so it must be called recordId.

- Now we can add a Screen element.

- In the Components section, scroll or search to find the Document Generator screen component. Drag and drop the component onto the screen area.

- You will now need to select a Template Source. Below are the following options:
- From Merge Connect:
- Select an Object.
- Once an object has been selected, click on Select a Template.
- You will be prompted with the Select Templates modal. Only one template can be selected.
- From a Text Variable:
- You will need to create a text variable where the default value is the TemplateID which can be found in the URL of the template in Template Builder:
[org url]/lightning/r/mergeconnect__Merge_Template__c/[TemplateID]/view
- You will need to create a text variable where the default value is the TemplateID which can be found in the URL of the template in Template Builder:
- User Selects Template:
- User that triggers the Flow will be prompted with the Select Templates modal.

- User that triggers the Flow will be prompted with the Select Templates modal.
- From Merge Connect:
- Optionally, if you would like to use the merged document for something like a Send Email action, then you could use Manually Assigned Variables under Advanced. Here you can set a text variable with Available for output selected that will capture the completed files ID. For a Send Email action, you would set the Attachment ID to this variable.

- Once you have completed setting up the rest of your screen flow, click Done.

- Click Save.

- Click Activate.

- For a Screen Flow you will need a method to trigger the flow, we will be using an Action. To configure this, go to Salesforce Setup, and click on Object Manager.

- Select the desired Object.

- From the right-hand side, select Buttons, Links, and Actions.

- Select New Action.

- In the New Action page you will need to set the Action Type to Flow. Then, select the created flow and provide a name for your action. Once completed, click Save.

- Finally, you will need to add your action to your page layouts. Click on Page Layouts, then select the desired page layout.

- Click on Mobile & Lightning Actions, then, in the Salesforce Mobile and Lightning Experience Actions section, click override the predefined actions.

- Drag and drop your created action into the Salesforce Mobile and Lightning Experience Actions section, click Save.

- Now you will be able to trigger your Merge Connect Screen Flow through a button.

- Once your merge is complete you will see the status of your merge with a hyperlink to preview the generated document. Your file will appear on the component once your screen flow is completed.

Document Bundling
- Navigate to Salesforce Setup > Process Automation > Flows.

- From the Flows page, click New Flow.

- Select Screen Flow.

- To create the Flow, we first need to create a RecordID variable. To start creating a new variable, click the box in the top left corner.

- Click on New Resources and select the Resource Type as Variable. Then set the Data Type as Text. For Availability Outside the Flow, check Available for input. Finally, click Done.

- Now, we can add a Screen element.

- In the Components section, scroll or search to find the Document Bundler screen component. Drag and drop the component onto the screen area.

- You will now need to select Bundle Options. Every option will need a Bundle Name provided. Below are the following options:
- Admin Predefined Bundle
- Bundle all documents on the record is an option that will automatically add files on the record the screen flow is triggered on to the Bundle modal.
- From a Text Variable
- You will need to create a text variable where the default value is a series of Content Document or Content Version IDs which can be found in the url of the View File Details: [org url]/lightning/r/ContentDocument/[Content Document or Content Version Id]/view
- User Selects Files
- User that triggers the flow will be prompted with the Bundle modal
- Preselect all documents is an option that will automatically add files on the record the screen flow is triggered on to the Bundle modal.

- Admin Predefined Bundle
- Optionally, if you would like to use the bundled document for something like a Send Email action, then you could use Manually Assigned Variables under Advanced. Here, you can set a text variable with Available for output selected that will capture the completed files ID. For a Send Email action, you would set the Attachment ID to this variable.

- Once you have completed setting up the rest of your screen flow, click Done.

- Click Save.

- Click Activate.

- For a Screen Flow you will need a method to trigger the flow. We will be using an action. Go to Salesforce Setup, and click on Object Manager.

- Select the desired Object.

- From the right-hand side, select Buttons, Links, and Actions.

- Select New Action.

- In the New Action page, set the Action Type to Flow. Then, select the created flow and provide a name for your action. Once completed, click Save.

- Finally, you will need to add your action to your page layouts. Click on Page Layouts. Then select the desired page layout.

- Select Mobile & Lightning Actions. Under Salesforce Mobile and Lightning Experience Actions select override the predefined actions. Drag and drop your created action into the section. Click Save.

- Now you will be able to trigger your Merge Connect Screen Flow through a button.
