Docs

Preview Analytics Merge

Try a merge before you save it, as the app's merge editor previews one: send the same dataSources and transformCode Create Analytics Data Source takes for a merge source. It answers each input after its SQL and what the code returns. Nothing is saved. A code error comes back in output.error, so you can fix it and try again.

POST

Headers

Optional headers
string

Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See Organizations.

Body

Arguments
array of objectrequired

The inputs, each one of your sync or fixed sources with an alias and optional SQL.

The sources to combine, as Create Analytics Data Source takes them for a merge source.

  • dataSourceIdstringrequired

    The input source, a sync or fixed source of yours, from List Analytics Data Sources.

  • aliasstringrequired

    The name the merge SQL and code read this input by.

  • querystring

    SQL that shapes this input before the merge, reading it as `src`. Leave it out to use the input as is.

string

The code that combines them.

The code that combines them, as for a merge source. Leave it out to see the inputs only.

Response fields

inputsarray of objects

Each input after its SQL: its alias and its first 10 rows.

  • aliasstring

    The alias the code reads it by.

  • rowCountnumber

    How many rows there are in all.

  • columnsarray

    The column names.

  • rowsarray

    The first rows.

isPartialboolean

True when an input is still on its first fetch, so only its rows so far were used.

outputobject

What the code returned: its first 50 rows, or error when it failed. Null when no transformCode was sent.

  • rowCountnumber

    How many rows there are in all.

  • columnsarray

    The column names.

  • rowsarray

    The first rows.

  • errorstring

    Why the code failed, or null when it ran.