I have a button on a step that invokes an api integration call via a rule. Based upon the results I’d like to either go to the next step (Step 4) if the api call results in a 200 status code, go back to a previous page (called Treez in this example) if the status code is 401, and if it is anything else go to the last Step (Step 4).
const data = await feathery.http.connect(‘Create on Source System’);
console.log(data);
if (data.statusCode == 200) {
console.log("Status code " + data.statusCode );
results.value = “Success”;
feathery.goToStep(‘Confirmation Page’);
} else if (data.statusCode == 401){
console.log(“Credentials invalid”);
feathery.goToStep(‘Enter Credentials’);
}else {
console.log("Failed with status: " + data.statusCode + " " + data.data.message);
results.value = "Failed, check response: " + data.data.details;
feathery.goToStep(‘Confirmation Page’);
}
Generally this seems to work, but the form itself gets hidden (there is a console log message that states the form is hidden) after I click the button and I am not sure why. Do you see anything that would cause that or adjustments I should make to achieve the result mentioned above?