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 Stambia's 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": "" } } }
Prerequisites:
- Stambia DI Designer S18.3.0 or higher
- Stambia DI Runtime S17.4.0 or higher
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!
Refer to this article if you want to learn how to retrieve the name of the node, for instance.