Reading JSON nodes with varying names
Sometimes, the name of a JSON node can contains itself data information.
In this case, the name of the node will vary on each file, on each occurrence or execution.
The xDI JSON technology offers the possibility to read easily this kind of nodes by specifying a name pattern in the JSON Metadata.
For instance, the name of the node below is the name of the person:
{
"json_person": {
"GIBBS": {
"id": 1,
"firstname": "Jason",
"lastname": "GIBBS",
"company": ""
}
}
}
Metadata Configuration
To read JSON files containing nodes with varying names, simply:
-
Open the Metadata
-
Navigate to the node
-
Set its Name Selection Pattern
This parameter is waiting for a regular expression.
At read, if the name corresponds to the regex specified here, the Runtime will load the node.
That’s all, you’re ready to load nodes with dynamic names!