cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
warren
Level: Powered On

Button Feedback response on Submission

Hi All, 

 

I have a situation where i'm using the 'Button' feature of powerapps for confirmation of submission. 

 

image.png

 

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?

 

Thanks!

2 REPLIES 2
ViStr
Level: Powered On

Re: Button Feedback response on Submission

Hi warren,

 

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.

 

For example:

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.

Viktor Strizhakov
Community Support Team
Community Support Team

Re: Button Feedback response on Submission

Hi @warren,

 

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.

Quoted:

"

Errors can happen when a record of a data source is changed. Many causes are possible, including network outages, inadequate permissions, and edit conflicts.

The Patch function 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 the Errors function to obtain the details of any errors. You can check for the existence of errors with the [IsEmpty] function in the formula IsEmpty( Errors ( ... ) ).

"

For example, to use Errors function, the following code could be used:

Patch(DataSource, EditRecord, NewRecord);
If(IsEmpty(Errors(DataSource)),
SuccessAction,
ErrorAction)

Adding the function reference:

Errors function in PowerApps

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,978)