How to show an error message if something is missing

I am building a page where the user can enter some values and click a button to save the entered values into a new table row. However, the user has to enter some of the values before the new row can be created. Thus, if something is missing, I want to inform the user about the missing data.

I found the Notify() function, but this is not what I want. I don’t want to send a notification or even an email, but just a message box or something.

How can this be achieved?

If it’s only about missing fields you can just create a form: Create and customize a form | Coda Help Center

If you need more complex validation rules, you can create a helper table and use the detail view as a form by adding a self-made submit button. You can disable the button with whatever rules you come up with and even have a field that displays a message with whatever is missing to enable the submision. If all the conditions are met, the button can be pressed and only then the values are stored in your main table.

If you really want a pop up (kind of) you could set up a view of the helper table, with a layout containing your error message and whatever buttons make sense. If the conditions are not met, when pressing submit instead of saving the data in the main table, you use OpenRow() to display the layout you just created.

Here you have a simple example doc showcasing both approaches

Hope this helps,

Pablo

2 Likes

Thanks, I guess these are all valid suggestions, I will try that.
But they also sound quite like an effort for such a small thing like a popup messge.
Why is there nothing “out of the box” in Coda - am I the first one trying to achieve this?

Hi,

You are not the first person to look for something like this, but implementing this would not be very straightforward, I think. (Even if it would be good to have.)

  • There is currently no “framework” to provide a pop-up message like that. The closest would be the automation functionality, but this is not immediate. There can be some time between the trigger and the automation. Second, the row needs to be saved for any automation to be triggered.
  • Should the pop-up message appear for a specific column?
  • for a set of columns?
  • Should there be a dependency, iow, if this column is filled, the following columns should also be filled, otherwise they can be left blank.
    P

But why not simply allow to raise such a popup via a formula?

There is no “pop-up” object. But it can do a openRow(), as @Pablo_DV suggested, which comes extremely close.

Especially if you take into account my comments about the various alternatives above. There is two aspects to this, one is displaying a message, the other is deciding when to display the message.

In the end, I think the effort from the maker would be about the same.

I don’t know how many other low-code platforms have you tried, but in my experience Coda, specially the formula language, makes most of things easier while allowing many advanced use cases.

Building user interfaces is not one of those things and we need to use all kinds of hacks to make our UIs a bit friendlier.

I agree that a simple modal object would be very neat and useful, but all in all, despite its shortcomings, I have not found any other tool that is so versatile as Coda and that brings so much joy to work with!

1 Like

I came across Notion first, then Coda. Used them together for a while, until I did my first nontrivial doc. Notion couldn’t handle it, Coda was a breeze, and I haven’t looked back.

Also used roam research for a bit earlier on, but roam research is a different kind of nocode…

There’s an experimental action that might be of interest: _CREATE_ERROR_MESSAGE()

image

3 Likes

Hey Rickard,

thank you very much, this seems to be exactly what I am looking for :+1:
I am new to Coda - could you please explain how I can integrate that into my page?

1 Like

That’s very cool @Rickard_Abraham, had no idea that it existed. How did you find out about it?

do you know of any list of hidden formulas/actions that is a bit more recent than this? A somewhat of a documentation of hidden formulas [Added mechanics of nested buttons] - Developers Central - Coda Maker Community

1 Like

Just use it like any other action _CREATE_ERROR_MESSAGE(“your message comes here”)

1 Like

I’m just scraping the front-end, I shared it in a maker discord a year ago or so but was asked indirectly by an engineer to not share the whole list, since there are some hidden formulas that can break docs if used irresponsibly

I’d love to share it though with Coda’s approval, perhaps excluding some formulas, but this isn’t something I’m prioritizing as of right now

2 Likes

There is no MsgBox (like in Excel), but I really like your suggestion!

1 Like

I just tried the _CREATE_ERROR_MESSAGE() call and it works perfect.
Exactly what I was looking for.

Thank you very much, Rickard!

2 Likes