Gonexa University

Initial training


The Gonexa Doc solution is Gonexa's historic solution for generating a document from a template in the format .docx. xlsx .pptx .pdf

We are going to break this training down into 4 steps :

  • Main principles of flow, action triggered on the update of a record
  • La présentation des Actions de Flux
  • Generate a document individually
  • Generate documents from a list view

Training requirements

  • Make sure click generation works
  • Know the process to be put in place

Flow Demo Org

Find our flow examples

☝️ Org of pre-designed flows

Go to our sample flow org to get inspired. Find the use cases most used by our customers.

  • address: login.salesforce.com
  • identifier: tester@gonexa.fr
  • password: Gonexa01

Gonexa & Flows

Save time and eliminate repetitive actions with Salesforce flow actions.

From the Salesforce Setup, go to Flows (Flow), and then click New Feeds.

Select the type of flow to set up.

The types of flow
  • Screen flow : Display parameters or information to the user before launching a click action. (Ex. Choice of the template and the output format before generation (click)
  • Flow triggered by a recording : Trigger an action when a Salesforce record is created, updated, or deleted. (e.g. modification of a status, check box...)
  • Flow triggered by a schedule : trigger a specific action at a scheduled time (e.g. generation of tax receipts every December 31 at 9 am)

Click on Create

Creating a recordID variable

💡 Tip; The recordID variable is almost systematic for all screen flows. It is used to variabilize the recordID field, and to provide the flow with the context from which we launch the generation.

  • From the toolbox, click on New Resource
  • Choose the type: Variable and give an API name
  • Select the Text data type, to store the id of the record to be generated.
  • Check the box: Available for entry
Add an informational screen

From the process, click on the + and choose the item: screen

  • Name the label and the API name

    💡 Tip; Rename the next button in the footer configuration to improve the user experience.

  • Drag and drop the desired component: date, checkbox, informative text...

Validate

Add an update action

To update the data entered in the previous screen, you can add an update action. It will trigger a next action.

From the process, click on the + and choose the item: update records

  • Name the label and the API name
  • Check the box: specify conditions for identifying records
  • Select the Salesforce object from which the field is to be updated (e.g. Quote)
  • Filter conditions with the record Id = the previously created recordID variable
  • Define the fields to be updated and their values. (Ex. ExpirationDate = Expiration Date and Status = Review)

Validate, save, name, and activate your flow.

Provision of the flow

Place the feed on your context.

  • Access your main object from Salesforce (the object from which the action is triggered)
  • Click on edit page
  • Drag and drop the Flow component to the desired location
  • Select the flow you want to call from the dropdown list
  • Check the box: transmit the ID of the record in this variable

Generate automatically

Our most famous action that will allow you to generate a document automatically

Action name: “Generate a document”

UNITARY GENERATION ACTION

Build your process at your convenience (screen, decision, success message...) and add the Gonexa action.

The 3 parameters of the Generate a document action
  • Add an item to your Action flow
  • Select the Generate a document action: apex-gnc__documentGenerationInvocable
  • Fill in the following 3 items:
  • Output format : call the value pdf, xlxs, pptx, or docx.

    You can vary this value with a screen by creating new choice-type resources.

  • RecordID : get the id of the record to be generated.

    This value must be variabilized with a text variable, available for input.

  • TemplateID : get the Id of the document template to be generated.

    This value can be varied on a screen or selected from the documents according to certain criteria such as the name of the document or the Azure ID.

Register, activate, and test.

Add a get registration item to your feed

Action name: “Generate a document (Future)”

UNITARY GENERATION ACTION

This flow action is similar to the Generate a Document action, the configuration is similar.

It is used to generate a single document asynchronously, this means that it will run in the background.

It includes the same parameters as the Generate a Document action, only the way it is executed is different.

Attention, Salesforce does not allow more than 50 future actions at the same time, so you have to be careful with trigger flows that use this action with a trigger that could be called more than 50 times at once.

Bulk Generation

Whether from a list view or from a trigger, mass generate documents

Action name: “Generate multiple document (<50,000 records)”

Mass generation action

Generate several documents at once from a list view.

Get records
  • Give it an API label and name
  • Retrieve records from the object in your context. (Ex. The generation of certifications (from contacts)
  • Filter records with the following requirement:

    Field: Id
    Operator : in
    Value : ids

Create the ids variable

To fill in the value field, create a new resource:

  • Resource type : Variable
  • API name: ids

    💡 Attention case sensitive name

  • Data type: Text
  • Allow multiple values (collection)
  • Available for entry

Validate

Add the Generate Multiple Document action

Add action on the page layout of your main object.

  • From the configuration object manager, access the object from which you want to start the generations.
  • Go to the Buttons, Links, and Actions tab
  • Create a new button such as List button
  • Name the label of your choice (e.g. generating certifications)
  • Paste the feed URL into the link.

    💡 Tip You can find the URL of your feed in the feed details.

  • From the layout tab of the list view button, add the new button and save.

Validate and test

Dynamic variables

Use a flow variable as data in a document

Inserting dynamic variables into a document

Sometimes you need to display one or more dynamic values when generating a document.

In a Salesforce flow:

Create a collection variable

Start by creating a collection variable in your feed. This variable will store the data you want to show in your document.

Assigning values to the collection variable

Add an assignment action to assign the desired values to the collection variable. The order of the assignments will determine the order of the tags to be positioned in the document.

Fill in the collection variable in the generation action

In the document generation action, activate the “Collection of Dynamic Values” parameter, then enter the collection variable used previously.

Position tags in the document

In your document template, position Gonexa tags to show dynamic values upon generation.

The tag to fill in is {! gnxdynamic|1}.

This tag shows the value of the first place in the collection variable.

Then replace the 1 with the number corresponding to the index of the value you want to display.

For example, {! gnxdynamic|4} will show the fourth value of the collection variable.