The best way to get response data back for testing is to force an error on the step after the response data is applied. Use the following steps to force an error on the step following the step that returns response data.
- Add a JavaScript preMap hook on the step that follows the step that generates response data.
- Select any script available to you, and in the Function field, type anything but the actual JavaScript function name:
- For example purposes, on the step that follows the Test Lookup step add a preMap hook, select any existing script, and set the function to asdfasdf (not an actual function).
The Test Lookup step has response mapping applied. So in this case, add the preMap hook to the FTP Import 1 step.
- When you run the flow, the preMap hook will cause an error on the FTP Import 1 step. You can then review the retry data from the dashboard after the flow completes. Open the error.
- View the retry data (which includes the "lookupData" array).
- You can then copy this data and paste it into the Dev Playground Handlebars editor.
Note: If you don’t have any flows that use a JavaScript hook that you can use for these purposes, you can use the following:
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
}
function postSubmitFunction(options) {
sleep(1000);
return options.responseData
}