Building doc for NHS: Continue to push buttons even if error?

Hey there!

I’ve got a table with a master button which, when pressed, it triggers two other buttons to press, one of them is a to send an email, the second is to send a text.

The problem I’m having is that if the first of these has an error (e.g. if they’ve entered the email incorrectly etc), the second button doesn’t get pressed!

Do you think you could help me figure this out?

I’ve tried ‘distancing’ the button via a cascade style setup e.g. by having the first button in the list press a button which then presses the email button, but that doesn’t seem to work :frowning:

Any ideas are much appreciated!?

Thank you!!

Hi Ben,

Is there some kind of error message (e.g. to let them know the email was invalid)? Or does it just silently do nothing?

Out of interest, is this a coronavirus related thing?

What you can do in this case is verify the information, what I mean is, if the info (like the email) is not correct or is blank you disable the mail button (via disable if inside the button’s settings) that way when the other buttons tries to press it it won’t, no error will happen and will continue to press the second button.

1 Like

Thanks Saul! So I’ve got it setup to disable the button if it’s blank, but how do I set up up to disable if the email address isn’t valid? Is there some method of email validation that I can add?

Thanks!

Hey Tom! Welcome to the community!

It gives an error message to say that the emails not been sent, but it doesn’t notify me that the second button hasn’t been pressed.

And yep! My friend runs a Pharmacy and is innundated right now so I’m trying to build him a digitised way of managing the prescription collection process so that patients aren’t going into the pharmacy until their medicine is definitely ready etc!

Thanks!

After some research I found this way to validate an email:
RegexMatch(thisRow.To.ToText(),"\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$")

Disclaimer:
It may not work for all proposes, but maybe the most common.
I found out that there are a lot expressions to validate emails and none of them work 100% so I suggest digging a little more

2 Likes

Ah amazing! Thank you so much for finding this!! Where did you find that? Always great to know additional resources/useful sites for things like this so that I can figure it out rather than bothering the community!

I’ve also had another idea to backup this, what do you think about this:

I could have the master button trigger a change in the row as it’s first action and then I could have an automation watch that row for the change and then, when it sees that change, that could then trigger the SMS button.

That way, even if there is an error in the email, it won’t stop it from triggering the SMS from being sent.

Do you think that would work too? Or do the automations have any delays or anything like that?

Just trying to make sure this is as perfect as possible since we’re dealing with people’s medicine here :slight_smile:

Really, they should have it so that subsequent buttons work even if errors!

No problem man! I found it in this page after series of google searches on how to validate email addresses :sweat_smile:

Yes that can do the trick, automations do have a little delay but no more than a few minutes.

:thinking: I’m don’t think you can send SMS through Coda.

I just did a little test and making the button press first button 2 and then button to send email, the button 2 works even if the button to send email fails.

Maybe the other button isn’t working?

Ah thank you for finding that!! Sorry I didn’t think to do that search haha - I assumed validating an email address would be well above my head - and I definitely try to stay away from regex whenever I can haha!

Hmm I’ll test it again, but in my text I did find that if the email send didn’t work it wasn’t triggering my next button to send the SMS.

The way I’m doing the SMS is through the Twilio pack, it works great! But maybe the combo of email send and using another pack like Twilio is what is causing the issue.

I think I’ll try implementing the regex and then backing that up via the automation hack as well because I want to make sure this is fool proof :slight_smile:

Thanks again for this man!!

Don’t worry man! I’m glad to be helpful!

Oh yes! if you try sending the email first and it fails it won’t push the SMS button, but if you send the SMS first and then send the mail, it will send the text and then try to send the mail, and even if it fails it still going to send the SMS

Oh that’s great to know!

1 Like

Thanks again for the insights, really appreciate it!! Implemented and all is looking great! Have a great weekend!

1 Like