Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need to use a JSON file - config.cfg as the config file for the entire project. This file contains details like, DB connection parameters , file paths which will be used in all jobs in the entire project. What would be the best way implement such scenario? The obvious answer would be to extract the fields from the JSON file and load them as context variables to be used across all jobs. How can i load the variables extracted from the JSON file to context? Could you please help me there.. Also, please suggest if you can think of any other approach for this scenario..Thanks in advance.
Hi,
So your JSON structure has a couple of repeating blocks, which you'll need to extract out one block at a time whilst also managing just the configuration for the singletons ($.GLOBAL object for example).
Unfortunately, that JSON structure doesn't really lend itself to being extracted cleanly using tFileInputJSON, tXMLMap or tExtractJSONFields
Hi,
Sounds like you need to extract the configuration from the JSON cfg file as 2 columns of key/value and then use tContextLoad
You are right. But, how do i extract the multiple(more than 50) config parameters into key/value? From tFileinputJSON or tExtractJSONFields, i get the parameter names as separate columns. I need to convert that as values for the field KEY. Can you suggest some component to do that?
Thanks,
DSK
Hi,
Can you share a sample of what your JSON config file looks like?
Hi,
I have attached the sample config file.
Currently, i am implementing this flow:
tfileinputjson --> tunpivotrow --> tcontextload
Please suggest if you have some better ideas to implement this.
Thanks,
DSK
Hi,
So your JSON structure has a couple of repeating blocks, which you'll need to extract out one block at a time whilst also managing just the configuration for the singletons ($.GLOBAL object for example).
Unfortunately, that JSON structure doesn't really lend itself to being extracted cleanly using tFileInputJSON, tXMLMap or tExtractJSONFields