Mega trick: Different "Expand row" layouts for the same row

@Paul_Danyliuk Thank you so much for talking through all that! Immensely helpful. Really appreciate you taking the time. :slight_smile:

This is awesome! Very useful! Good job :clap: :clap: :clap:

1 Like

Since this thread got bumped — here’s a new solution:

There’s an experimental formula OpenRow() now, which allows opening a row in a context of any view (with the view’s layout and “x of y” navigation count). No URL manipulation required.

So instead of

OpenWindow(Format(
  "#_SomeViewID/{1}&modal=true",
  thisRow.Url().Split("/").Last()
))

you can now simply do:

thisRow.OpenRow(SomeView)
6 Likes

How would (SomeView) be configured in the formula?

2 Likes

When you type in .OpenRow() it will offer layouts in the parentheses.
So, you need:

  1. Select that Item from the recently created table
  2. Append .OpenRow(SomeView)

I have 2 detail views in the table (View 1 and View 2). How do I select a specific view to add to the button, defined above as (SomeView)? Do I need to append the URL and if so, how?

Not an URL, you just select a table/view reference there:

thisRow.OpenRow([View 1])

or

thisRow.OpenRow([View 2])
3 Likes

@Nick_Solyom

the discussion that I mentioned earlier.

p

Alright @Paul_Danyliuk - Love this, but Im currently finding some bug (or missing something?)

Im utilizing this in a document right now and then openrow() is working perfectly when pressed on the master DB table. Heres the formula:

But the moment I access/press that exact button on a view (where the user will be pressing it) - it does not work? It just opens the view of that table which it is being pressed from. Any ideas why that is?

Are those two views actually from the same table as thisRow is on? Because that could be one reason.

Another reason could be Display type never matching a string of text because it appears to be a list of text values, not a single text value (and hence a different type). You must’ve forgotten .First() after some .Filter() somewhere in your doc?

I (kind of) figured it out - or at least narrowed the problem down further.

To answer your question - yes. Those rows are all on the same table.

I made another button that utilized the URL manipulation rather than the Openrow() formula and it had the same problem.

I think the issue lies in the detail view itself. The buttons themselves work in any view (table or card) anywhere in the document but they do not work when pressed inside of a detail view.

Weird. Can’t figure that last piece out.

1 Like

I think I’m experiencing the same issue @Scott_Collier-Weir

Buttons work perfectly from table view and launch the appropriate view. However, I can’t use them from the layout view itself.

Example layout where the buttons don’t navigate to
the correct view:

Yes - I couldnt get it to work in a detail view, I had to go with displaying the button on a card instead where it did work

@Paul_Danyliuk , thanks so much for your contributions on here and for getting us this far.
Wondering if you have a workaround for the issue above?

I’m testing this out today and the openRow() formula will not accept a string value as the second argument. When choosing from a table/view the url leads to an error page

For people who implemented this solution in the past, are your formulas working? Did you add the “#_” to the front of your view id to make it work? Something may have changed here

It does not expect a string or a URL — it expects a View reference, literally. I.e. the same thing you’d put before a .Filter()

Understood. I still received the error page when linking to a table or view.

Can this formula be used to link to a specific layout for a row?

Great tip about OpenRow(), @Paul_Danyliuk, that can help a lot, thank you!

Have a question: can you somehow store references to tables/views in a column of a table and then use that column in a button formula?

I tried to manually add links to tables/views with @ symbol like that:

(References in Projects table column are table views, not separate tables).

And then use that column in a button column formula in a different table like that:

OpenRow(thisRow, thisRow.Initiative.[Projects Table])

But I get this error:

OpenRow expects parameter viewOrLayout to be a table, but found value ('Renovation-Projects_su9ct#Projects-Renovation_tueZl '), which is a list of text values

Maybe you know how to fix it? Will be grateful for a tip!

P.S. Would be great if you could use layout name in OpenRow() formula.

1 Like

I’m having this same issue. Any solution?

I was working on this today and finally got a solution I was happy with.

In my case I wanted a “Delete” button on the Tasks table, that when clicked opens a view to “Confirm Delete” the row with another button.

  1. Delete button opens the view
  2. Confirm Delete buttons deletes the row - This button is only visible in the “Confirm Delete” view, hidden in tables, etc.

To get it working using the openRow() formula, I found that the formula expects a table reference, and uses the layout for that table.

To get it to work, I had to

  1. Create a view of the Tasks table, which I called Confirm Delete Tasks View. I put this on a page called Modal Views which I intend to hide.
  2. On the Confirm Delete Tasks View table, I clicked on the row and created a new layout to only show the “Confirm Delete” button
  3. I went back to the “Delete” button formula, and changed the code to
thisRow.openRow(Confirm Delete Tasks View)

Now when the button is clicked, it opens the expected view in a modal, and the “Confirm Delete” button is there as expected.

6 Likes