cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Creating a success alert

I am trying to create a success alert for when the user submits a form. Unfortunately, I am running into few issues.


In screen 1 the user fills out the form.

The form OnSuccess function is the following:

If(FormType="New",
Navigate(MyTravelRequestList,ScreenTransition.Fade,{SuccessMessage:"New Request Created"}),
Back()
)

In Screen 2 I have a group with Rectangle, X icon and text field
The groups visible property is set to this function:

If(IsBlank(SuccessMessage),false,true)

Now This does work as I launch the App the Success Alert is not visible and when I create a new record it does display the message. However I can not get the X (close the alert) button to work.

This is what I put with no success:

UpdateContext(SuccessMessage:"")
UpdateContext(SuccessMessage:blank())

None of them work and I get this error:

The first argument of 'UpdateContext' should be a record. 


Picture:
1.png

 

Any help appreciated. Maybe there are better ways to implement a success alert message? Also I need to use a variable for the message as it will not always be the same message for success.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Creating a success alert

I found my mistake, very silly one, you can delete this post.

Forgot to add { } for Context variables

In order to fix replace:

UpdateContext(SuccessMessage:"")

With:

UpdateContext({SuccessMessage:""})



View solution in original post

6 REPLIES 6
Highlighted
Anonymous
Not applicable

Re: Creating a success alert

I found my mistake, very silly one, you can delete this post.

Forgot to add { } for Context variables

In order to fix replace:

UpdateContext(SuccessMessage:"")

With:

UpdateContext({SuccessMessage:""})



View solution in original post

Highlighted
Helper IV
Helper IV

Re: Creating a success alert

@Anonymous i was looking for this option,

 

what i want to know is this will appear only on the gallery screen once the item add or edit ? 

 

 

Highlighted
Helper V
Helper V

Re: Creating a success alert

Hi @Anonymous!

 

Do you know if is possyble to, instead of click on close botton, give a 2 seconds time to 'pop1' desappear?

 

Thank you.

 

 

Highlighted
Advocate I
Advocate I

Re: Creating a success alert

@rgparisoto
I came across this post but looking into another approach:

varShowMessage:false
This variable controls the visibility of the SuccessMessage.
OnSucess (when the form has been transmitted)
   varShowMessage:true
   start a timer (duration 3s)
OnTimerEnd
  varShowMessage:false

 

Thats the theory 🙂

I cant't make the timer start when the form is in Edit mode.

Highlighted
Anonymous
Not applicable

Re: Creating a success alert

There is no longer a need to show success messages this way.

 

PowerApps now has a Notify() function that will display a success/warning/error/info message.

 

More on Notify()

Highlighted
Advocate I
Advocate I

Re: Creating a success alert

I have just figured a simple solution for this try the following code in the button 'OnSelect' properties.:

 

SubmitForm(EditForm2);Notify("Form Submitted",Success)

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,377)