cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
warren
Frequent Visitor

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
Advocate I
Advocate I

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
v-micsh-msft
Community Support
Community Support

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,963)