Using SQL Connector

Hi all

I am implementing the SQL connector, to connect to a SQL database, but am struggling to define process variables from the data retrieved by the SQL connector, can anyone just lead me in how to set this up on the output mapping.

The field I am trying to retrieve is AvailableLeaveDays, and I have inserted the following in the result expression field:
{
“AvailableDays” : connectorOutput.get(0).AvailableLeaveDays
}

The above gives me an error, so not sure what I am doing wrong. Please help???

Hi @andriesduplessis !

First of all thanks for your question :slight_smile: Let me try to help.
In the documentation, we can see that depending the SQL query (in your case I assume it’s a SELECT) the result is returned in the form:

{
  "resultSet": [
    {
      "name": "John Doe",
      "age": 29
    },
    {
      "name": "Jane Doe",
      "age": 27
    }
  ]
}

So with your example, the mapping might be something like this:

{
  “AvailableDays”: resultSet[1].AvailableLeaveDays
}

Let me know if that helped,
Jonathan

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.