Slice virtual column with show up if not empty

Hi all I have a table master note, and create a table view for it

Phong_Lam1_0-1645005557381.png

 

For the  3 column [ID Customer],[ID log],[ID Members] (they are ref column of table customer, table Log and Table Members) how could I create a virtual column with the expression that will show one of these three column if they have value (the logic is only 1 of them on the row have value). So I don't have to create 3 columns [ID Customer],[ID log],[ID Members] on the table view but just 1 virtual column only.

Thanks !

0 8 402
  • UX
8 REPLIES 8

You don’t need a new column, you can control when each column is displayed, in this case if it has value, by putting this expression in its “Show?” Field:

ISNOTBLANK([_THIS])

 

 

The problem is I put it in table view with many rows of data, so all these columns at some certain rows will have data. That's why I want a virtual column to show data of those 3 columns, thanks

You mean, you want to show just 1 column instead of showing 3 columns? Try creating a virtual column with this formula

IFS(
ISNOTBLANK([ID Customer]),
[ID Customer],

ISNOTBLANK([ID Log]),
[ID Log],

ISNOTBLANK([ID Members]),
[ID Members]
)

 

 

Thanks @JuneCorpuz , but this error show up

Phong_Lam1_0-1645092917604.png

 

What is the column type of those three columns?

Phong_Lam1_0-1645094414446.png

It's ref column. but If I changed the [ID customer] to Text, the problem is fixed, I don't know why ?

Do you know why I could not have all these 3 columns in ref type? the VC column with the formula is Text type

Hello Phong,

This is what is happening. You can keep the three columns in Ref type. Now if you want to copy the value in another column, in our case it is the new virtual column, you have to make sure either condition is fulfilled.

1. The origin and destination columns have the same type, or

2. You make appropriate type conversion accordingly. 

The first option means setting the Type for the virtual column as Ref. In this case you'll only have one choice of destination table to set as reference. Since you have three origin columns referencing three different tables, AppSheet will show you ref values for one table correctly, while the two others will have a broken-reference yellow triangle warning next to each value displayed, which might not be our best option.

In the second option, we will set the VC Type as Text, and we will only have the text values displayed but it will not be a clickable reference. This seems to be OK since you want only to use them in a table display. So in this case you'll have to do the appropriate type conversion from Ref to Text as follows:

IFS(
  ISNOTBLANK([ID Customer]), TEXT([ID Customer]),
  ISNOTBLANK([ID Log]),      TEXT([ID Log]),
  ISNOTBLANK([ID Members]),  TEXT([ID Members]),
  TRUE, ""
)

 

 

Top Labels in this Space