Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is often useful to be able to pass information to HCL Leap an application via URL parameters. These can be used to pre-populate fields or make decisions in the receiving application on what to show/hide to a user. This technique can be used between Leap apps or between any other application and Leap. 

The best part is that URL parameters are very easy to use in Leap.

In my example I have two Leap appsapps. The first one acts as a menu allowing you to select the city and job that you are interested in. The second app is a job application form. URL parameters are used to pass the city and job information is interested in to the 2nd app.  

...

1st App

2nd App

Parameters appended to Leap URL:

Code Block
languagexml
&city=Washington&job=Technical+Support


JS to get the parameters:


Code Block
languagejs
app.getUrlParameter('city');
app.getUrlParameter('job');


...

Step 1 - Create the URL and call it

The URL is built in one Leap app app based on selections the user makes. When city and job are changed (onChange event) some JS builds the URL with the correct parameters and sets the Apply Now web link.

...

The next step is to capture the values of the parameters in the receiving application and populate the Leap form form fields - job and city. To do this I use the following JS which is tied to the job application form onNew event. It sets variables 'city' and 'job' to the parameter values and then sets the fields to the value of the variables.

...

Code Block
languagejs
var city = app.getUrlParameter('city');
BO.F_SingleLine.setValue(city);

var job = app.getUrlParameter('job');
BO.F_SingleLine0.setValue(job);


Leap URL URL Structure

It is useful to understand this since Leap uses parameters to open different forms and to also open existing forms which have been saved to the databasethe structure of an application URL.

Example of opening an existing form and record

Code Block
languagexml
http://domain<domain>:port<port>/forms<context>/secure/org/app/appID/launch/index.html?form=formID&id=RecordID

...

Code Block
languagexml
http://domain<domain>:port<port>/forms<context>/secure/org/app/appID/launch/index.html?form=formID&parameterName=parameterValue&parameterName=parameterValue

...