How to get the RowId from button press?

I’m making a simple customized Slack pack for our company, to send Slack block messages via button clicks or automations. The Slack message includes an URL button, that opens the row in a modal when clicked. Everything works great, but I’m trying to simplify it for my colleagues.

Example on how the formula looks, just to give you an idea on what the link looks like:
https://coda.io/d/link_to_the_table+ “/r” + RowId(thisRow) + “/&modal=true”

As my colleagues are inexperienced with programming, having to manually add a formula like that to their tables is too much to ask for. Instead, I’d want to put the bold part within the pack code, so all they have to add is the table link.

So, the question is: How can I get information (within the pack) on which row the button was pressed, without sending RowId(thisRow) as a parameter?

Probably a very trivial question, but I couldn’t find anything about it in the forums or the docs.

Hi @Daniel_Leis - No such thing as a trivial question! Unfortunately this isn’t possible today, as Pack’s aren’t given any context about where exactly they were triggered from. So no matter what the user will need to pass in at least some information about the row.

One option to simplify things a bit is to have them use the ObjectList() formula:

thisRow.ObjectLink()

That will generate a full URL to the row, without needing such a complex formula.

Thank you for the response. The reason I have that formula is to be able to link to a view instead of the main table. We have one view for our warehouse staff and one view for admins, as well as the main table. Using ObjectLink links to the main table as far as I understand.

Any plans of adding table context support? It’d be very helpful and let my team setup what they need instead of rely on me each time something needs to be added/modified.

I think it’s very unlikely that we’d support for table context in the near term. The team is very conscious of security, and so far has preferred that Packs get very little information about where they are used. Additionally they envisioned Packs being building blocks with inputs and outputs, and allowing them to pull context from the doc without it being explicitly defined as a parameter sort of breaks that model.

I think a more likely scenario, and one that others have requested, would be the ability to pass an entire row as a parameter to a Pack formula. Perhaps then the Pack would get some metadata about the row, such as the view it came from, etc.

1 Like