This lesson will cover the following topics:

01 Getting Started

Before starting, please check out our previous lesson on working with variables. In this video, we will learn how to populate variables from your parameters. We will focus on Map to URL and Encrypted ID.

02 Add Variables

First up, add a variable. You can choose any variable type you like, but in this tutorial, we will use Global Variables.
1. Navigate to Project Settings > Tools > Custom Variables:

Screenshot of Titan project settings displaying how to enable debug mode and click on custom variables

Note: ensure that Debug Mode is enabled so that when you preview your project, you can view your variables.

2. In the Custom Variables panel, click on Static, and choose Add a Static Variable:

Screenshot of Custom Variable window displaying the static tab showing how to Add a Static Variable

Note: Whenever you want to set variables from a parameter, you need to use Static Variables.

3. Next, give your Static Variables any names you like. Below we have chosen to name our variables “variable1” and “variable2”. After this, click Apply:

  Screenshot of Custom Variables window showing the Static tab

4. Next, enter Preview mode by clicking the option on the top right of your page. Then navigate to Debug:
Screenshot of preview mode with the debug mode displayed

5. In Debug mode, you will be able to view your variables, but they are not yet populated:

Screenshot of Debug Project window showing how to view your variables

6. To populate these variables, navigate to your URL in preview mode, add an “&” and enter values for your variables, such as variable1=true and variable2=false:

Screenshot of the URL in preview mode
7. After this, click enter then open Debug, and you will see your variables are populated:

Screenshot of the Debug Project window

Note: In the preview, you only need to use “&” but for a published URL you will need to include a question mark. You can concatenate as many variables as you like.

03 Map to URL

1. To make use of Map to URL, navigate back to your Static Variables, click the kebab menu on a variable or variables, and check the Map to URL option:

Screenshot of Custom Variables window displaying static variables tab showing how to enable Map to URL

2. Click Apply and save your project. This option ensures that your URL will not be lost when you navigate away from your page or reload it.

3. The Map to URL option also ensures that any changes you make to your variables are mapped to your URL. Let’s see how this works by use of an example:
  • Add a button to your project by dragging it from the element panel onto your canvas.
  • Next, select the On Click Action action option on the Button Element, and then the + icon next to your action:
Screenshot of the On Click Action window displaying Start + icon

4. Next, click Affected Elements:

Screenshot of Add Node window showing Affected Elements node selected

5. Then, select the variables you have configured, and choose to set their value to anything you like before clicking Apply. Below it has simply been set to “hello”:

Screenshot of add node/ affected elements window displaying configuration for the select the variables

6. Navigate back to your preview, hit refresh, and click on your button. You will see that your variable values in your URL have changed to the values you mapped in your On Click Actions:

Screenshot showing preview mode of the example project

In summary, if you want to ensure the variable value in your URL doesn’t get lost when refreshing your page, or that this variable value changes upon certain actions, then you need to select the Map to URL option.

04 Encrypt the ID

When working with Salesforce Record IDs, we never want to pass them as they are because this is not secure. For this reason, we will encrypt the ID before passing it. Any sensitive ID you pass to your Titan Web form should be encrypted.

Below we will describe how to add this extra layer of security:

1. Login to Salesforce and ensure your Titan package is installed.
  • Navigate to your Flow Builder, create a new Flow, and choose Record-Triggered Flow:


Screenshot displaying New Flow screen with Record-Triggered Flow selected

  • Next, configure the start of your flow by selecting the object whose records trigger the flow, here we have chosen Account. Then decide when to trigger the flow and set any conditions before clicking Done:
Screenshot of Configure Start window with select object highlighted

2. Add the FT_Encryption_Util Apex Action:
Screenshot of New Action screen with FT_Encryption_Util Apex Action highlighted

3. You need to stipulate
  • field_api_name_to_encrypt
  • field_api_name_to_save_encrypted_value (120-150 characters but this can be more)
  • object_Api_Name
  • record_id


 Screenshot of Edit Apex Action window displaying the stipulated fields

4. Click done, save your flow, and activate it. Then, in this instance, we need to create an Account object to trigger our flow. Your encrypted ID will display on the Account object:

Screenshot of Salesforce Accounts window displaying the Encrypted ID

Note: Don’t forget to add your encrypted field to your page layout when working in Salesforce Lightning.

5. Navigate to your Titan Web Project and paste the ID in the preview URL, where it is equal to your variable:

Screenshot displaying the preview URL

6. Next, test this encrypted ID works by running a Get and populating these fields with the Account data.
  • Visit Project Settings > Salesforce:
Screenshot displaying the Titan Project Settings with Salesforce tab highlighted

  • Then click “Create New”:
Screenshot of the Salesforce Integration window displaying the Get Record tab with the Create New button highlighted

7. Next, select the object in Salesforce you would like to pull the data from, here it is Account:

Screenshot of the Map Salesforce Fields window displaying the Object Settings tab

8. After this, set up conditions. Here the encrypted field is equal to variable1:

Screenshot of the Map Salesforce Fields window displaying the Conditions tab

9. Next, set mapping, so here we have chosen to map the Text field to Industry and the Text field2 to Account Name:

Screenshot of Map Salesforce Fields window displaying the Mapping tab

10. After clicking Apply, and saving your project, head back to your preview.

Screenshot of preview mode of the example project

11. Click refresh, and you will see your data pulled through:
screenshot showing how the data displays in the example project

05 Got Feedback?

Additional Resources