Assign "add row" buttons a view-specific modal

I’ve seen a handful of folks asking about adding a new row via a button, but using a specific view and not the base table to do so.

Currently, the “open row for editing” option in buttons will always open the base table view. (I.e. even if the button is configured to add to a specific view, the modal that opens to enter your details will use the base table’s default, including layouts and hidden columns.)

We’re hoping to make some internal improvements that allow for different layouts or view settings here, but in the meantime, here’s a workaround (instructions in doc):

Hope you find this useful! Curious to see if others have found novel ways around this problem.

5 Likes

Thanks for posting this. I recently needed to do this and had to piece together info from several different posts across the forums (and it took quite a lot of time). I think this post will be very helpful to others.

In the end, I settled on a slightly different approach. There are ideas from the OP above that I like, and some I like from this one (such as using Url() to get the URL). Perhaps I’ll rework my own to integrate the “floating blank row” approach as opposed to the noop/delay approach to deal with race conditions.

RunActions(
  AddRow(
    [Base Table]
  ),
  _Noop()._Delay(0),
  OpenWindow(
    Url([View of Base Table])
    + "/r"
    + [View of Base Table].[Row ID].Last()
    + "/&modal=true"
  )
)
3 Likes