Using context variables in a DSQL map
Use the getContextVariable function to call variables from a
Job.
Before you begin
- You have created an input and an output structure. You can use the JSON samples below to create your structures.
About this task
In this example, you want to map an input JSON structure with an output that is similar but has two more elements that need to be populated from context variables set in a Job.
The input data looks like this:
{
"company": "acme",
"items": [
{
"item": "hammer",
"amount": 5.55
},
{
"item": "screwdriver",
"amount": 7.23
}
]
}
The output structure looks like this:
{
"company": "",
"date": "",
"items": [
{
"item": "",
"amount": 5.55,
"taxes": 2.1
}
]
}
Procedure
Results
{
"company": "acme",
"items": [
{
"item": "hammer",
"amount": 5.55,
"taxes": 0.6659999999999999
},
{
"item": "screwdriver",
"amount": 7.23,
"taxes": 0.8676
}
]
}