Notify User on Button click

Hey guys,

I created an app that lets the user select a value from a picklist, an then hit a button to create a new row. However, if the user clicks on the button before having selected a value from the picklist I don't want to have a row created because it would then lack essential data.

So, after digging in this forum for a while, I came up with the run option
=NOT(ISBLANK($[PickingList]))

Thing is, now users get no feedback and might end up hitting the button continously, and then frustratedly give up. Instead I'd like to inform the users that they have to select a value first.

I tried the following:

  • a hidden DataCell "Show Message"
  • a Content Box "Please select a value" with visibility condition "=$[Show Message]"
  • a second button action with run option "=ISBLANK($[PickingList])"
  • an Update Screen action when clicking on the Content Box containing the Picklist Data Cell setting the value of "Show Message" to FALSE

Results:

  • Clicking the Add Row Button always adds the row, regardless of if a value is selected or not. Neither does it set the value of "Show Message" to TRUE.
  • The action in the Add Row Button shows a warning "Invalid reference in Formula" for the Formula "=$[Show Message]"
  • Selecting a value from the Picklist doesn't change the value of Show Message to FALSE. I really have to click the surrounding Content Box.

I'm at a loss now. Any ideas on how to get my setup fixed? Many thanks in advance!

Hey @Bjoern -

I needed to do something similar, and I approached it this way.

First I created two buttons. Lets call them $[Add Row Button] and $[Blank Button]
Then I create my $[data cell 1] which is a visible, editable row link.
Then I create a message in a content box (usually in red text) that says something like "Please select an option to add record" - this visibility is tied to whether the $[data cell 1] is null or not. So I think it would be =[$data cell 1] = ""

Let's go back to the buttons.

$[Add Row Button] will be the button with the automation that adds the row to your table. I won't detail that because it sounds like you have it figured out. All you need to do is set its visibility to =[$data cell 1] <>"". Once it is clicked it should add the row for you. If I were you, I would then have the button point to a new screen that confirms the record has been added and then gives the option to "Go home" or "Add new record" which could point you back to the Add Record screen we were just on.

$[Blank Button] should say the same thing as $[Add Row Button], but change its background fill to a lighter shade so that it appears grayed out. Set its visibility the same as the warning message: =[$data cell 1] = "" and when it is clicked have nothing happen via automation.

So to summarize, when a user wants to add a row via this screen, the button will be initially grayed out and a warning message saying "add data" will appear. Then when the user has selected data, the "add record" button will appear and the warning message will disappear. Once that button is clicked, the automation will run to add the row, and the app will navigate to a confirmation screen which gives the user an option to add a additional rows or navigate back to home.

Hope this helps!

1 Like

I'll also add this here for reference in addition to the excellent information from @Jared:

1 Like

@Kamran - I wish I'd known this article existed earlier! I would have spent so much less time learning through trial and error. Thanks for sharing!

3 Likes

Many thanks to both of you, @Jared and @Kamran!

Since I wanted a one page experience the option with a second confirmation page wasn't my favourite. So I tried building it from scatch with the page Kamran linked. I got it running, finally, but had to play around with the visibility conditions of the two buttons. I ended up with the following:

Action button: =$[PickAbholort]<>""
Disabled button: =OR($[PickAbholort]="", ISBLANK($[PickAbholort]))

The ISBLANK-only variant mentioned in "How to Add ..." wasn't working for me. Maybe because Picklists behave differently than other input fields?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.