FormType is context variable and it is either Edit (for when the people are editing an record) or New for when people are creating record.
So, when people are editing a record, the Manger field populates with what is already set. If this is a new record, the filed populates with Manager variable (which is a collection and takes info from Office365.Users).
I want to send an email after there has been an edit or new record was created. So, on the EditForm OnSuccess property I have this function:
So basically, if the form is for new record it sends email to my email, with subject TEST NEW, with body of ManagerField Email and CC to my email, and moves to a page where all requests are displayed. If its edit it send email to my email with TEST MODIFY as subject and Manager email.
So it all works and I receive the email. However if the user changes the Manager on the New record creation (changes the default manager) and then Submits the form when the OnSuccess fires ManagerField.Selected.Email resets to the default value not the one entered by the user.
How would you guys activate this flow before the form puts back default values? I could put the flow on the Submit button but then if the record is not created it would still send an email that’s why I wanted to put it on OnSuccess. Is there any way to restrict the form to resetting to default values before OnSuccess function fires, or somehow capture the value user put in before it is reseted to default value?
I assume that your flow is triggered by a PowerApps button. Per my understanding, once the form is submitted, the form will put back its default value, so when OnSuccess fires the field will reset to the default value but not the one entered by user.
When you put the flow on the submit button, how did you configure the code?
What kind of record do you want to submit to data source? Not sure if you could consider to combine IF function or others to restrict the data submitted to data source.
Best regards, Mabel Mao
Community Support Team _ Mabel Mao If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I found a work around which I use for now. On the submit button OnSelect I setup a context variables for each user input. If the form is submitted successfully, in the OnSuccess property I use the context variables which do not reset.
Also I do not know if this is posible but maybe there could be a return value when the form is submitted successfully to use like ThisItem with the recently added item, so PowerApps would assign ThisItem to the newly created record in a SharePoint list. Maybe an idea to consider for the future.
I had the same issue. I generally wanted to compare the value of what was being submitted vs. what the current value was. If the values were different, I would run the flow to update the record.
I used SharePointIntegration1.Selected.FIELDNAME to get the current value and the DataCardValue to get what was being submitted. I had to use the Set() function to store these in the onSave trigger, and it had to run before the SubmitForm() ... Is this essentially how you did it or did you figure out something different?