Pop open a row with a button

Right now, you can’t open a row with a button. You can either click the “Expand row” icon on the far left of the row, or you can press option + space on the keyboard. Sometimes, though, it might be useful to open a row when you click a button, especially if you’re pairing it with other buttons in order to perform simultaneous actions.

Until we add that to the product, here’s a (albeit hacky) way to open a row with a button:

Step 1: pull in the full URL of a popped-open row. Make sure to put it in quotes to prevent the table from autocompleting to a lookup column:

Step 2: Break apart the URL into 3 different sections: base URL + row ID + tail piece

The number after the “/r” is the row ID, and the tail is everything after the row ID:

Step 3: Concatenate all the pieces together using the CONCATENATE() formula:

Step 4: Replace the hard-coded Row ID with the formula ROWID():

Step 5: Remove the quotations from the beg of the base and the end of the tail, and then make the base and tail URL’s formulas so they auto-populate:

Step 6: Add a button and choose the action “open hyperlink”. For the URL field, select the Concatenate column:

Ok, phew :sweat_smile: that should be it. Congrats for making it through all of those steps! Now that you have this button that opens a row, you could also create another button that, for example, modifies the same row. Then, create a third button that pushes both of the buttons.

8 Likes

I just came up with another workaround, by setting up a new “Current” table to hold a “Current row” variable for the row that I want of the old table, then a new Section and View of the old table filtered to show just that one view, then cut-and-paste the URL into a new “hyperlink” column of the “Current” table.

Then a button in the old table to set the current row as the “current” one, and a second button to go to the “Current Row View” section, then an “edit this row” button in the Old Table to press those two buttons – set current row, and go to current row view.

All the details here: Create button to go to related record?

Best,
Maria

1 Like

There’s now a much easier way to do this. Just use the formula

Activate(thisRow)

in a button to open that row. Here’s an example:

10 Likes

Thanks @justin. So much easier than the URL concatenate workaround!

Question: I keep having the issue of the view closing when I click “x” to close the annoying “no action taken” dialog box that pops up with the view of the row.

Any ideas on 1) how to prevent the dialog box “no action taken” from appearing to begin with (it doesn’t appear when using Coda’s innate expand row functionality) or 2) how to prevent the expanded row from closing after X’ing “no action taken”.

Thanks :slight_smile:

CloudApp

@Keith_Punches that might be a bug. Let me talk to the engineering team and get back to you. In the meantime, if you ignore the notification it will disappear after a few seconds.

Thanks for your quick reply @justin

Yep, disappears after a few seconds most of the time but sometimes it hangs.

When closing the popup… I think the action puts focus on the underlying page. Seems to be the case anyway because the underlying table or layout is always outlined in blue like it’s been selected.

Hope that helps. Have a great day and thanks again.

@Keith_Punches the snackbar issue should be fixed now :smile:

1 Like

Great thank you @justin!

@justin It would be great to add a standard formula to do the opposite of Activate(thisRow)

Use case: I’m building a form intended for mobile and I want to make it easier for a user to open and close rows via buttons rather than the Coda app UI.

1 Like

I’ve used a two button setup for this situation. Each button is just a “Open Hyperlink”.

First, create an “Open” button with the following code:
Concatenate(thisRow.Url(),"&modal=true")

Next, create your “Close” button that you can display on the popup, but hide in the table view:
thisTable.Url()

The “Close” button just links to the table you came from, so it acts to close the popup window.

4 Likes

Hi @justin, this works to link to a row in a table, but not to link to a row in a “view of a table”.

For example, I have

  • Table 1
  • View of Table 1

Each of those has a different layout so I want to open the element with the layout corresponding the View of Table 1 but there is no easy way to do this.

Do you have a similar hack to open the row in a specific view of a table?

1 Like

@Raul_San_N.H you’re correct. Your best option is probably to just open the row in the view using the expand icon on the row (without a button). The Activate() formula is a bit hacky anyway :smile:

@Raul_San_N.H if you build your URL like this - it would load appropriate layout.

Url(pick the view ) + ‘/r’ + RowId(thisRow) + ‘/&modal=true’

5 Likes

Hey @Krunal_Sheth, this works. Thank you for the hack ; )

(it has taken us some time to figure this out)

and @Raul_San_N.H you might find this useful Ever wanted to open a specific column in "BIG cell editing mode"?

2 Likes

This is only slightly off-topic, but right now if I use the above mentioned URL concatenation to build an endpoint for a QR Code, it will grant complete access over the document, not only the expanded row. Is this in consideration in the Permissions talks? Or would the permissions update nullify this issue?

edit: Not only does it allow full access, I don’t even have to be logged in to Coda to see everything.

@Joshua_Upton - not entirely following - just giving a URL out would never give out permissions to the doc to anyone.

I just scanned a QR code with a url to an opened row within a doc, i was not signed in to Coda on my phone, and It allowed full access to the entire doc.

edit: I said full access, it is view only, however that is bad enough for my case.

it shouldn’t be a view access either . if you didn’t share the doc - no one can get to document using URL. possible that you were logged in to your account on your phone?

I definitely wasn’t logged in, as it had the Sign In button on the top right of the browser.