Six Stars

How to use tFileInputJSON when deployed.

I'm trying to return dummy data from a REST request/response but I cannot seem to figure out how to upload the JSON (dummy data) from the input file since when I deploy this job the file out.json doesn't get uploaded with it. How can I include my JSON dummy data?2017-12-05_1353.png

1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: How to use tFileInputJSON when deployed.

The location of the dummy file needs to be a valid location on the server where you deploy the service.  If your local development folder+file location differs from the location you want to use on the deployed server, you can solve this by using a context as a variable to hold the location.  The context can hold your local development folder+file when running it locally.  When deployed, you can manually change this context to represent the deployment server folder+file location.

 

Another way to provide dummy data for local running is with a tFixedFlowInput with Use Inline Content.  Basically you can paste your json text into the Content field as a 1 row, 1 column dataset.  Then use the tExtractJSONFields to parse this out.

 Capture.PNG

2 REPLIES
Six Stars

Re: How to use tFileInputJSON when deployed.

The location of the dummy file needs to be a valid location on the server where you deploy the service.  If your local development folder+file location differs from the location you want to use on the deployed server, you can solve this by using a context as a variable to hold the location.  The context can hold your local development folder+file when running it locally.  When deployed, you can manually change this context to represent the deployment server folder+file location.

 

Another way to provide dummy data for local running is with a tFixedFlowInput with Use Inline Content.  Basically you can paste your json text into the Content field as a 1 row, 1 column dataset.  Then use the tExtractJSONFields to parse this out.

 Capture.PNG

Six Stars

Re: How to use tFileInputJSON when deployed.

Thanks pal, helpful as always.