Hi All,
Sorry if this isnāt the place to ask this. My collection is running succesfully when run manually, but failing when run via collection runner.
The 1st request is a GET that pulls data from an API, passes the data into an array, and stores it in an environment variable as a JSON array.
- Array being created: var name = [];
- Data from request being stored into JSON array: name.push(data[i].respondentDetails.name);
- Array being stored as variable Name: pm.environment.set(āNameā, JSON.stringify(name));
The 2nd request is a POST that parses the environment variable storing the JSON array, and sets a new environment variable as the first item in the JSON array.
- Name variable being passed: var name = JSON.parse(pm.environment.get(āNameā));
- 1st item of JSON array being stored as variable current_name: pm.environment.set(ācurrent_nameā, JSON.stringify(name[0]));
This works fine when each request is run manually; and when a collection runner is manually triggered; however fails when a collection runner is run from a schedule.
The 1st request runs fine, but the 2nd fails, throwing up the following error message: JSONError: No data, empty input at 1:1
I am really struggling to troubleshoot this issue, and any help would be much appreciated!
Thanks in advance.