Call URL

You can call to the third-party websites to use data your need in a database, for example, currency exchange rates, companies’ logos, cities and addresses, etc. In this case the Call URL workflow action can be added to the trigger or custom button.

The “Example: Call URL” database demonstrates the "Call Url" functionality with Text, JSON and XML response parsing. To check how it works, just order a free trial of the “Example: Call URL” database.

The Call URL workflow action performs HTTP GET requests (support for POST and more advanced options is planned for the next stage) and understands responses in plain text, XML and JSON formats. To create this type of action:

Select a corresponding option on the workflow action type selecting form.

Beside the general purpose (Name and Description fields) the action has the Url field. Also, you should use <% %> code blocks to provide parameters.

Upon request the service can either return a failure code [this will be added in a log and further processing will be stopped] or report OK and provide an error message in the response. To help dealing with such situation there is the Error Formula field - you can extract error message from the response or return NULL if response is OK.

To deal with the data returned by the server there is a new Response() function that takes three forms:
Response() with no arguments returns the "raw" content of the server response - you can use it if the server provides the result in a plain text format.

Response("text") - extracts named data from the response in the XML or JSON format. In case of XML the text should be a valid XPath expression, in case of JSON it's a string in form of "[index].property". The function returns the value as text.

Response("text", Type) - performs as previous one but also tries to convert the result to TeamDesk-specific type.
You can use calls to Response() in both error formulas and assignments.


In the Name field enter the name of the action.


Notes field holds any comments you need to keep for this action.


In the Method field choose the GET, POST, PUT, PATCH or DELETE HTTP calls.


In the Url field enter the external url that should be called. Use <% %> code blocks to provide parameters.


HTTP headers consist of name: value pairs each pair is placed on separate line. As each header type require value in its own format, we do not expect much use for database content. Nevertheless, headers behave like quest strings. Read more …


This field is visible when the method selected is POST, PUT or PATCH. You may interpret the Body as Text, Form, XML or JSON. Read more …


In most cases Auto-Detect option works fine. Yet if a server reports a wrong format, you may force response interpretation as Text, XML or JSON using this option.

Error Message

In the Error Message field an Error Formula can be entered. This formula can extract an error message from the response or return NULL if the response is OK.

Once the action is created, the Assignment can be added to it:

Use the following form to create the assignment for extracting the value from the third-party website and updating this value in the column:


In the From field enter the formula extracting the value from the third-party website. This value will be later on inserted into a predefined record field.


In the To list select the field (column) to which the formula calculated value should be inserted.

Call URL’s On Error option

The quick recap on Call URL logic:

Step1: TeamDesk calls third-party server.
If there is a network error, roll back all changes and display error message.

Step 2: TeamDesk evaluates response status.
If status indicates error, roll back all changes and display generic message.

Step 3: TeamDesk evaluates Error Message formula, if not empty.
If formula evaluates to some text, roll back all changes and display text as error message.

Step 4: Execute assignments and subsequent triggers and actions normally.

The On Error option controls the behavior at step 2.

If set to Stop Execution we use old logic – this option is a default.

If you need greater flexibility, set On Error to Continue Execution. Step 2 will be skipped. Error Message formula, if set, handles both successful and error responses. The formula has a chance to evaluate response status using the ResponseStatus() function. Then it can extract a specific error message from server’s response and abort execution if needed, or return NULL to suppress error and continue execution.

If execution is not aborted, you can use assignments to flag whether the record was successfully processed or not, for example:

If(ResponseStatus() = 200, “OK”, “FAILED!”) // to Status

Next: Mobile Device Record Create