Job data

Jobs contain data, such as name, files, Job ID, custom data...

These data can be standard Job data, or custom Job data.

Standard Job data

Standard Job data are saved to the Job via the Create Job node. They are added to the database at Job's data root level.

Example
This will result in the following JSON object in the database:
{ 
    "state" : "Job_state", 
    "name" : "Job_name", 
    }

Custom Job data

Custom Job data should always be saved to the Job in the custom section. You can do this in Create Job > Define (custom) data to be assigned to the created job. You need to define a JSON path that selects an element in the JSON document and a value that you want to set for the specified data path.

Example 1

Path Value
custom.cusname CustomerX
custom.cusID 12345
identifier Job_442542
This will result in the following JSON file in the database:
{ 
    "identifier" : "Job_442542", 
     "custom" : {
        "cusname" : "CustomerX", 
        "cusID" : "12345", 
    }
}
Note: In case the fields cusname or cusID do not exist, they will be created.

You can also leave the Path empty. In this case, the data are sent to the root level of the Job data in the database.

Example 2

Suppose you have created the following Job form in Handle Form:
Where:
  • The JobID key is identifier.
  • The Customer Name key is custom.cusname.
  • The Customer ID key is custom.cusID.
In Start From Kiosk > Job Data Variable Name, you have specified a variable for the Job data, called project_data. The variable will have this content:
{
project_data: {
    source: "jacket",
    value: {
        identifier: "78910",
        custom.cusname: "ClientA",
        custom.cusID: "3636"
}
}
}
Where:
  • identifier is a direct parameter.
  • custom.cusname and custom.cusID are custom parameters. It is important to use the dot notation custom.X to add the custom data in the custom section.

You can leave Path empty and define the variable in Value:

Path Value
project_data
In this case, the data in of the Job form (that are in the variable) are sent to the root level of the Job data in the database. This results in the following JSON in the database:
{ 
    "identifier" : "78910", 
    "custom" : {
        "cusname" : "ClientA", 
        "cusID" : "3636"
    }, 
}
Note: In this example, the identifier value can also be set in the Create Job node itself (in the Identifier field). In this case, and in all other cases where there are values in both the direct parameters (coming from the node fields) and the Job form data, the values of the direct parameters will always be used and the data in the variable will be overwritten.

Custom properties per file: best practice

In case you want to add custom properties for each file in the Job, it is best practice to use a nested job object for each file. In that case, one parent Job contains a child Job per file, and you can save the custom data inside the child Jobs:

Parent Job
  • Child Job 1
    • File data
    • Custom data
  • Child Job 2
    • File data
    • Custom data