Specify which inline view to use in a detailed view

Yossio
New Member

It is too difficult to guess/change which inline view will be used while using a related field in a defailed view.
Should have a way to just point on the desired inline view rather that trying to guess which one it will choose (or the need to create a specific slice and create a ref to it, just to force it to use the inline view of that slice)

Status Under Review
25 14 3,906
14 Comments
Fabian_Weller
Gold 1
Gold 1

Your are absolutely right.

Here are some info I gathered together, how to control which view is used as inline view:

MultiTech
Gold 4
Gold 4

@Yossio
They have given use the tools to solve this - just never really went back through the community and answered things like this.

CONTEXT(“View”) is the solution you’re looking for.

When used in conjunction with ShowIF - you have absolute control over where and when something should be seen.


Context(“View”) = “The_view_you_want_to_see_it_on”

or

in(Context(“View”), list(
“The_view_you_want_to_see_it_on”,
“Another_view_you_want_to_see_it_on”
))

or the opposite:

Context(“View”) <> “The_view_you_DONT_want_to_see_it_on”

not(in(Context(“View”), list(
“The_view_you_DONT_want_to_see_it_on”,
“Another_view_you_DONT_want_to_see_it_on”
)))

Grant_Stead
Silver 5
Silver 5

Well, Well, Well… The master continues to teach… HAHAHAHA
THIS is such an awesome use of IN to avoid a whole bunch of nested BS… Lately I’ve been using this…

SWITCH(CONTEXT(“View”),
“view_name_first”, TRUE,
“view_name_second”, TRUE,
FALSE)

Fabian_Weller
Gold 1
Gold 1

Hi @MultiTech_Visions you are right.
But I think this is not working for something like this?

I have an image column where I can put a floorplan.
When this column is not empty, I want to see the map inline view.
When this column is empty, I want to see the table inline view.

The reason is:
This formula is not evaluated in the context of a row, so column values are not available.

So for this case I have to create a second REF_ROWS Virtual column. And here I can use SHOW_IF depending on the image column.

Grant_Stead
Silver 5
Silver 5

Your nailed it.
I was trying to figure out the reasons why I was suffering through this the other day.

MultiTech
Gold 4
Gold 4

If you were to create a “live” dashboard, using some sort of User-based control system - where they can select criteria that filters the dashboard for content (client, location, project… that sort of thing) - then you won’t be looking at something at the row level, you can use the slices to grab your data.

isblank(INDEX(New_Slice[Floorplan_Image], 1)

Why use INDEX() too?

Notice I put the slice[Column] part inside an INDEX(); this is because I need to make sure I’m checking that the [Floorplan_Image] column is empty… not the slice.
If you just wrap ISBLANK() around the slice call, it won’t process as you’re expecting because it’s finding a record - even though that record contains an empty [Floorplan_Image] column, there’s still a record there… therefore it’s NOT blank.
It’s only when we specify the actual column value (by pulling it out with INDEX() ) that we get the true desired result.


By creating a slice that holds the “live” data the user is working with, you can then get all sorts of fancy with dashboards and views.
3X_d_5_d51363a862e7ab883241c312ac5d7f271579cdd3.gif

Ethan_U
New Member

Hey @MultiTech_Visions does this work on dashboard views which include detail views? I have a dashboard with a table view and a detail view for purchase order line items. I have an inline table inside the detail view for a column and I can’t seem to get it to only show my desired table view, it keeps wanting to show a deck ref view i have just for another purpose. I used your expressions in the display but still no go.

I even tried in both directions, first on the view I want to see…

and then the one I dont …

hmm any help would be awesome man

MultiTech
Gold 4
Gold 4

Hey @Ethan_U

This is a common problem, and the easiest/best solution is to create a new slice/view combination specific for this view configuration.

The view that will determine how a reverse reference column is displayed is determined by the “Referenced Table Name” setting inside the column settings.


For instance, in this REF_ROWS() column, you can see the table selected is the regular base table.

If I wanted to switch to another view, specific for a subset of data, I would:

  1. Create a slice for that subset
  2. Create a specific view
  3. Change the “Referenced Table Name” in the REF_ROWS() column.

That control inside the reverse reference column directly controls which data source (table/slice) your column will use.

The slice doesn’t actually have to have any criteria, sometimes I create a slice simply so I can see data in another format.

  • For instance, here’s a virtual column that displays “Trap Counts” as a histogram - vs. a table.

I had to create an additional slice, then setup my view how I wanted, and change the reverse reference column to that slice.


The problem you’re running into is that you’ve got two inline views for one data source, and appsheet can’t really handle those situations too well.

  • In this instance, it’s usually the first one alphanumerically that’s used as the “base view” for all reverse references.

So one trick you might try is to name your views with numbers at the front - with the primary one being 1, and all your others as 2. (Not sure if this would work though)

Ethan_U
New Member

Dude you’re amazing! thanks so much for the thorough reply.

Signed,

Padowan

Fabian_Weller
Gold 1
Gold 1
alphacp
Silver 2
Silver 2

Great tip, thanks for this. Adding a VC with another related list has solved a problem I have struggled with for days. In my case I wanted a different view type depending on a value of a column. Adding a show condition on both related columns achieves this well.

Marc_Dillon
Platinum 1
Platinum 1

I just posted a separate Tips’n’Tricks thread about this situation (or similar) yesterday. Slightly different situation, but same concept.

Status changed to: Open
Pratyusha
Community Manager
Community Manager
 
Status changed to: Under Review
Roderick
Community Manager
Community Manager