You can't let a microflow wait for the user input. So the MF you created creates the new survey and shows the form. Then build a second microflow and replace the save buuton on the from shown by the first MF by a MF-trigger (button) that handles the calculation. If you want to see if the survay has already been filled you'll have to store this somewhere. So maybe on create of the survey have the survey associated with the user entity and create the association with the first MF and then in the second MF try to retrieve the survey with the association to the user (currentuser) and count the resulting list. In that way you can see if the survey has already been filled by the user.
Optionally to make a microflow "wait for the user" you could try something with the microflow timer from the app store. This can trigger until a condition is met e.g. Although this is not very pretty and might cause performance loss depending on the actions that you're doing in the MF. I would recommend the first suggestion.
A second try: You have a survey entity with some references. You have a form that displays the survey entity with the reference selectors. Based on the selections you want to calculate something. You want to know if the survey has been filled for a particular person already. If so then a yes/no question needs to be asked, asking for confirming if the user wants to fill the survey for a second time or overwriting the survey e.g.
For this to work: On the survey overview form make sure a form is opened with a new survey entity in a dataview displaying the reference selector for the person. Add a MF button that will retrieve the surveys that have the same person selected. With a split check if something is returned.
First the if nothing is returned part: after the split perform a change object action for the survey (this saves the survey with the reference to the person. The add an action to open a second form with a dataview of the survey entity, but now with the reference selectors (so the user can answer the questions) the input for this open form action is the survey that server as the input for the MF. The calculation can be done by means of an event MF, so make sure the first save is done without events.
Now for the case where there is already a survey filled with the same person referenced. It depends on what the user can choose. If you would like to overwrite the previously filled in survey then perform a change action on the retrieved survey making sure the references are cleared e.g. and in the next step open the retrieved survey in stead of the survey that served as input.
If you want to ask the user if he wants to fill in a second survey for the same person then the steps are some more elaborate:
You'll need to add an entity for asking the question with a boolean and a relation to the person entity (same as for the survey), lets call the entity QUEST. Now in the action after the split create a new QUEST object then retrieve the person object from the survey and in the third step change the newQEUST entity by setting the relation to the person with the retrieved person. As a last step open the form with the QUEST entity. On the QUEST entity form add a MF button that handles the save and if the boolean is set to yes (I want to create a second survey for the same person) add actions to retrieve the person from the QUEST entity record, create a new Survey record, Change object NewSurvey setting the reference to the retrieved person and as a last step open the NewSurvey entity in the form that allows for answering the questions.
I hope this helps,
How do I get a microflow to run after that specific save button? It can run after commit, because that would create a loop. Any suggestions?
Replace the Save button with a "custom" Save button, iow, paste a Microflowtrigger which you'd name "Save"and which does what you need to get done.
I have several "questionaire" like screensequences that are handeled that way