I need to save the user input (signature as a file, by calling an Apex Method) when the user clicks the standard "next" button in the flow screen, I am using user input validation for flow screens, so whenever I click next, I get the validation message telling me there's no signature, because the imported function returns a promise.
Basically, I'm trying to save the user input in the validation function, but I can't because of the async processing.
How can I tackle this?
What I tried:
Enclosing the saving signature logic inside a delay function:
var delayInMilliseconds = 1000; //1 second
setTimeout(function() {
// Call Apex method logic
}, delayInMilliseconds);