Using the UI Builder

The UI Builder allows you to format a string that is passed to a REST call or a JavaScript function with field tokens that are replaced by their values.

Field tokens are defined with matching double curly brackets:

{{param1}},{{param2}}

That set of field tokens sends a string separated by a comma:

<value of param1>,<value of param2>

Note that the comma is included. So the following string

{"Name":"{{Name}}","Title":"{{Title}}"}

produces the JSON:

{"Name":"<value of Name>","Title":"<Value of Title>"}

Variables that you define with curly brackets appear as fields in a form that is presented to the user. You get to define the label for the field and a description. For example:

SmartDraw REST URL

This presents a form to the end user that looks like this:

End user form

Using the UI Builder with the JavaScript Extension

Typing this into the Script Parameters field creates a JSON string that is passed back to the JavaScript function as paramString:

Javascript extension UI builder

Using the UI Builder with the REST Extension

The REST extension has three places you can include parameters.

Adding Parameters to the URL

Type your URL as:

https://myurl?param1={{param1}}&param2={{param2}}

This creates a form that looks like this:

REST extension url parameter form

Adding Parameters to the Headers

Type in the Additional Headers box the following:

Adding Parameters to the Message Body

Type the format you want into the message body. If the body needs to be JSON type:

{"param1":"{{param1}}","param2":"{{param2}}"}