LB Named Constants

LB Named Constants is Logic Builder extension that allows you to parametrize values used in a flowchart in Sugar without even changing the flowcharts.

LB Named Constants can be used to set:

  • connection details to external systems like API Key, login and/or password
  • assigned user for distribution logic
  • thresholds for control logic

So let’s say that there is a distribution logic to set Assigned users for Cases based on Product Type. Instead of setting the assigned user directly in the flowchart, you can create a Named Constant for this.

When it is needed to change Assigned User, you can update the corresponding value for LB Named Constant in Sugar even without changing and re-deploying the flowchart.

Creating new Named Constant consists of:

  1. Creating and defining Named Constant in Sugar
  2. Using it in a flowchart

How to create a new Named Constant?

Once LB Named Constants extension is successfully deployed, the new module LB Named Constants is added into Sugar.

Navigate to LB Named Constants module and create a new record:

Name – provide the name for Named Constant so you could easily pick the needed one in a flowchart

Type – select the type of the Named Constant:

  • Date or Datetime when constant represents some static date
  • Integer when constant is numeric (commonly used for thresholds, e.g. 3 for 3 Days after Case is Created)
  • Relate to select team or user
  • Text when no types above fit to describe the Constant. Commonly used type for API Keys or records IDs.

Value – set the value for the Named Constant

Here is an example of Named Constant that stores an API key for integration with Active Campaign:

How to use Named Constant in a flowchart?

For Named Constant there is a dedicated operator Named Constant:

In the dropdown there is a list of all Named Constants from Sugar instance which metadata is currently uploaded into the Project.

If you have just created a new Named Constant – please update Sugar Metadata to access the newly added Named Constant in a flowchart.

Click ‘show’ to see what current value of the Named Constant is loaded into Project. But please note, that the actual value of the Named Constant is retrieved from Sugar when a flowchart is fired. This means if you updated a value of Named Constant in Sugar but didn’t refresh Metadata in Logic Builder, then in Logic Builder the old value is shown, but when the flowchart is fired the new value of the Named Constant is in use.

Below is an example of usage Named Constants to create a request to Active Campaign. Named Constants store API Key and Account Name to compose the request:

So, to use Named Constant simply add Named Constant operator in a flowchart, select the needed one in the dropdown and link its output to the value that must be parametrized.

Once Named Constant Value is needed to be changed, just open Named Constant record in Sugar and change the value (and save changes).

Can I Export and Import LB Named Constants records?

Yes, you can migrate LB Named Constants from one Sugar instance to another using the standard Sugar export and import (for example, if you would like to deploy changes from sandbox to production).

 The following fields must be imported:

  • Name
  • Type
  • Value

Note: When importing LB Named Constants records between Sugar instances, only the LB Named Constants records are migrated. The logic described in Logic Builder is not migrated. To transfer the logic generated in the Logic Builder, you need to install the appropriate packages on the instance.

Can I apply to LB Named Constants records Role restrictions?

Yes, standard Roles Configuration can be applied to the module LB Named Constants.

Click to rate this post!
[Total: 0 Average: 0]

Leave a Reply

Your email address will not be published. Required fields are marked *