JSON JQ Transform
TIP
An example of how to use this task can be found in this use case.
Task in alpha phase
This Data Factory task is in phase. You can contact the Product-Live team at contact@product-live.com if you want more details and get an early access.
The JQ Transform task allows processing JSON data using the JQ query expression language.
Task name:
Examples
json
{
"name": "json-transform-jq",
"taskReferenceName": "jq_transform",
"type": "SUB_WORKFLOW",
"inputParameters": {
"data": {
"input": "${workflow.input.json}",
},
"queryExpression": ".text = (.data.input | tostring)"
}
}
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
json
{
"name": "json-transform-jq",
"taskReferenceName": "generate_comment_threads",
"description": "Generate comment threads",
"optional": false,
"type": "SUB_WORKFLOW",
"inputParameters": {
"data": {
"message": "${workflow.input.comment}",
"suggestions": "${fetch_suggestions.output.json}"
},
"queryExpression": ".data.message as $comment | [.data.suggestions[] | { \"object\": \"comment_thread\",\"comments\": [{\"message\": $comment}],\"targetType\": \"suggestion\", \"targetId\": .id}]"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
json
{
"name": "json-transform-jq",
"taskReferenceName": "filter_comment_threads_opened_and_not_assigned_to_my_account",
"description": "Filter comment threads opened and not assigned to my account",
"optional": false,
"type": "SUB_WORKFLOW",
"inputParameters": {
"data": {
"accountId": "${workflow.input.context.userAccountId}",
"commentThreads": "${set_day_old.output.result.commentThreads}"
},
"queryExpression": ".data.accountId as $accountId | .data.commentThreads[] | select(.isClosed == false and .accountAssigneesId[] != $accountId)"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Definition
Property | Type | Required | Description |
---|---|---|---|
The name (or type) of the task | |||
The unique name of the task in your job. It is used to reference this task in the workflow. | |||
The functional description of this task in your job. | |||
The type of the task. It must be SUB_WORKFLOW . | |||
true : the job continues if there is an error on this task. false : the job fails. | |||
Input parameters of the task. See below |
Inputs
WARNING
This task does not support the Data Factory variable as an input parameter.
Property | Type | Required | Description |
---|---|---|---|
An object containing the input data to be processed. The input data is stored in the input property. | |||
A valid JQ query expression. The expression can reference any property defined in the inputParameters object. The result of the query expression is stored in the result property inside the output object. |
Outputs
Property | Type | Description |
---|---|---|
The first results returned by the JQ expression | ||
A List of results returned by the JQ expression | ||
An optional error message, indicating that the JQ query failed processing |