I have a situation where i'm using the 'Button' feature of powerapps for confirmation of submission.
Ideally, what should happen is when the user confirms that he/she wants to submit by clicking <Yes> button, that will submit the data to the repository and store it there. This is ALL good and can be achieved using the 'onSelect' property of the buton.
But what i would also like to be able to do, is to have the app informing the user if their submission is successful, or has failed. This is for the scenario that sometimes, there might be a server issue etc.. which prevents powerapps from submitting the data.
I know that there is a 'onSuccess' property for type FORMS (i'm not using FORMs in the background, but a custom screen&gallery), but i don't see that in the 'button' item. Is anyone aware of any workaround that can address this? Is there some sort of property that can be leveraged from powerapps that stores the submission status of the button when clicked?
as I belive, you could check is datasource countaint any submitted data or not. And if it is so set visible any message about successed submission.
Yes.OnSelect = Patch(submit data to DS);Set(SubmissionResult;CountRows(Filter(YourDS;FieldToBeVerified=NewValue)))
After click on Yes button You get count of patched records in global variable SubmissionResult. And at this stage You could set related from SubmissionResult variable Visible property of some info message. That is just an idea of workaround your scenario without using forms.
Yes there is no "OnSuccess" property could be used with the Button control, but we could take use of the Errors function to check the Record submit status.
Errors can happen when arecordof a data source is changed. Many causes are possible, including network outages, inadequate permissions, and edit conflicts.
ThePatchfunction and other data functions don't directly return errors. Instead they return the result of their operation. After a data function executes, you can use theErrorsfunction to obtain the details of any errors. You can check for the existence of errors with the[IsEmpty]function in the formulaIsEmpty( Errors ( ... ) ).
For example, to use Errors function, the following code could be used: