Show a message before submitting a form

I want to display a message/warning in a popup, or in a Show or Text column type, when a user changes the recipient's name on a form, during an update. The purpose of the message is to remind the user to change the email when the recipient's name changes.

When adding a new row, the form allows the user to choose the recipient from a drop-down list and AppSheet automatically enters the corresponding email.

AppSheet 1.png  AppSheet 2.png

To do this, I have entered the email formula in the โ€œInitial valueโ€ field of the email column because, if for some reason the user has to enter an email different from the one in the App, the user can change it.

AppSheet 3.png

The problem with the formula in the "Initial Value" field is that if the user has to update the form with a different recipient, the email will not change. That's why I want to show a message or warning to remind the user to change the email.

I have tried different ways without success.

I will appreciate any suggestions.

Solved Solved
0 11 227
1 ACCEPTED SOLUTION

Alright, 

I really needed to see more the app to answer you proper. 
But if you want to show a pop-up inside the form view, you can't.

You can also display thos warning message before the user opens the form, it is useful.

View solution in original post

11 REPLIES 11

POSSIBLE SOLUTIONS

If I understood what you meant, you don't need to update anything, you could just use a formula that returns the email if this is a reference. You just need a table of this person with an email registered. Then you use the expression [Recipent].[Email] and it will also return the email for you, it could be a virtual column if you want.

Second possibility
in this situation I'd so this: 
1) Create a column and name it UPDATES (or whatever you want) and set this as changecounter, so it will count the updates for this row. If you're adding a new row, it will be zero.
2) Go to the edit action settings and in the Behavior enable the option "Needs confirmation?"
and in the confirmation message use an expression just like that:

peterson_0-1712689476628.png

But if you want a warning every time you update, you can simply set the message without any formula, just need confirmation. but it will appear before the form opens, which is a good thing.

 

Thanks @peterson .

Sometimes, recipients want to receive an email at an email address that is not registered. This is a rare scenario, but it happens. This is why it is not possible to use the first suggestion.

I want the message or pop up to display as soon as the recipient field of the form has been changed / updated, before the form is submitted. That's the best time to display it.

Before posting my question, I tried the second possibility you mention. Here, the message is displayed after the form is submitted (not before).  So far this is the closest option I have found.

Is there a way to display the message immediately after the change or before submitting the form?

Yes this is possible.

Just make a new action and set it as "go to another view of the app" toggle the "Needs confirmation?" and write the message you want. You can also use some condition in the behavior, if you want to. You need to use the linktoview expression that will take you to the view you want. if you want to be more specific you can use a linktorow it would be something like this LINKTOROW([_THISROW].[ID],"View_Detail") This way you'll be taken to the exact detail you just saved. See below:

peterson_0-1712755211975.png

After this go to the "Views" and go to the the particular FORM view, scroll down and you'll see one section called behavior:

peterson_1-1712755451802.png

 

Here you can choose one action to run after the form is saved, by default it is "go back to details" or something like this. Choose the action you created, and everytime time you save (or depending on the condition you want) you'll see a pop-up window with the confirmation message and after confirming it will take you to the view you want.

Ta-Da!!! This is how I do it.

 

What I'm looking for is for the message to be displayed before the form is submitted.

It seems the closest option is to display the message after the form is submitted. As you described in your last post, this can be done by creating an action and linking the "Saved Form" behavior to this action. Besides that, the system text needs to be customized in Settings -->View-->Localization.

Thanks for taking the time on this @peterson.

Oh, sorry. I misunderstood. 
Yes it is possible too.  Follow the steps:

1) Create an action go to another view of the app then use the formula:
LINKTOROW([_THISROW].[ID],"View_Form")  
PS: Replace the view name with the action form view.

2) Use a Needs confirmation and set the message and conditions you want.  

3) Call this action: EDIT it will be duplicate and be called edit 2 probably, but you can change teh view name and set this as primary action only for detail views

4) Hide the actual "Edit" button. 

READY!!! Every time you hit the edit button you'll receive a pop up message and will be directed to the form related to this row.

I have a question:  when you mention to create an action and the use of the "Needs confirmation" option, does this mean that the message will show up after submitting the form?

It means that when you click in edit you'll a message and after you click Edit the form will be open  isn't that what you need? The message before updating ?

Don't forget to change the icon for a pencil

I created a workaround to hide or show columns, depending on what the user selects. I'll try your suggestion later to see if it works.

Thank you

Alright, 

I really needed to see more the app to answer you proper. 
But if you want to show a pop-up inside the form view, you can't.

You can also display thos warning message before the user opens the form, it is useful.

After trying different ways, I think you are right. Within a form, it is not possible to show a popup or some kind of message when deleting the content of a field and enter a new content.

Thank you

Late to the party here, but curious if you tried this:

  1. Create a virtual column [Email Check] with your ANY(Select(Contact[Email],[_thisRow].[Recipient]=[Recipient])) formula 
  2. Create a show column [Warning] with your warning (i.e. "You have updated the recipient name. Please update the email address to "&[Email Check]&" or other desired email address")
  3. Add a show_if condition for your [Warning] column that [Email]<>[Email Check]
  4. Add your [Warning] Column to your form

You could also update your [Email] initial value to =[Email Check] so that it updates when the recipient is changed

Top Labels in this Space