I have a self registration flow which asks the user to enter a username. I then have a "Get Records" on the user object to see if that username exists. If it exists I set a Boolean variable "hasError" to true and return the user back to the flow where I display an error on the field "Duplicate username"
This works well. So the customer now enters a unique username and presses next to go to the next screen. I then reset the Boolean variable "hasError" to false.
Now on the second screen, the hits the "Previous" button to go back to the first screen, the error is still visible because the "hasError" variable is still true. It seems the screen captures snapshot of all variables and does not update the variable when the flow updates the variable.
Query based field validation is quite common. Does anyone have a process that will allow me to perform this type of validation and control the error message based on the user action?
#flow@Amit Kumar Thank you for the response. I am aware of this feature for lightning components, but I am trying to avoid using a lightning component for this use case.
I have tested this feature with a lightning component and I don't think this feature works as I don't think the variable "refresh" applies to variables used in "Component Visibility".
I could potentially update the lightning component to handle the visibility based on an attribute, but I hope there is a neater solution.