Set to show a view based on selection

Hi,

Can we set to show view based on selection of fields such as attached screenshot below. Based on the field type Input Product as : Measurable or Ready Product I want the below table view to change. For ok instance if the Input Product as Measurable Product then I want view showing only following columns : Item Name,Qty,Pricelist Rate,Amount.

I have created the views accordingly.but not sure where to add the expression. Have tried link to view but it didnโ€™t work.

0 1 92
1 REPLY 1

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Boa_Casa

You can.
I suggest you create slices with the columns you wish to display.
letโ€™s say:

  1. yourSliceWithColumnsDependingOnCriteria1
    source table : yourChildrenTable
    columns: you pick the one you want to display for criteria1
  2. yourSliceWithColumnsDependingOnCriteria2
    source table : yourChildrenTable
    columns: you pick the one you want to display for criteria2

Then, letโ€™s get back to your main table columns.
You must have a column, that you decided to rename โ€œwindow blindsโ€ and that probably was named first: โ€œRelated windowBlindsโ€.
For explanation purpose, letโ€™s call it โ€œrelated Childrenโ€.
Assuming its expression is:
REF_ROWS("yourChildrenTable", "yourRelationIDColumn")
your workaround will use its expression.

Please add a virtual column, letโ€™s name it โ€œchildrenCriteria1โ€, and its expression will be:
REF_ROWS("yourSliceWithColumnsDependingOnCriteria1", "yourRelationIDColumn")
another one, same idea:
REF_ROWS("yourSliceWithColumnsDependingOnCriteria2", "yourRelationIDColumn")

Finally, you will use a show_if condition on these โ€œlist of refโ€ virtual columns.

And you will set your show_if expression for the column โ€œchildrenCriteria1โ€ this way:
[columnCriteria]="criteria1"
the same for the โ€œchildrenCriteria2โ€ column:
[columnCriteria]="criteria2"

and please remember to untick the โ€œrelated Childrenโ€ show option.

This way, the columns of the expected slices that you set for your criteria will be displayed, and the other will be hidden

Let us know if that works for you !

Top Labels in this Space