Hi Anushree, welcome to Mendix.
What you are describing is exactly the way microflows operate:
- During execution, they do not listen to events. They only get triggered by them.
- A ‘show page'-activity will always get executed as the last activity in the flow, also if it is placed earlier on.
- Only one ‘show page'-activity will get executed since this means leaving the microflow.
Microflow can not:
- have any customer action during execution.
- have a ‘Are you sure’ popup during execution. Only before the start, see microflow-setting "Confirmation”
- halt, wait for an event, continue
So those are the obstacles.
To get what you want:
- create a first microflow which ends with calling a page
- have that page contain the button that the user can click.
- have that button trigger a second microflow
- have that microflow show page1 if choice is 1 and page2 if choice is 2
Your example is even more complex because apparently you want page1 to get shown if the user clicks the button, but page2 to get shown if the user does not click the button. To get that you would need to add the microflow timer addon from the AppStore.