If "not blank" command?

Hi Team!

Is there a command through if/else which will insert a variable if the cell/column within DataBlaze is "not blank"/has anything in it?

I have some custom fields which will vary at times, and I would like to insert their contents, if they are not blank of course

Thank you!!

You can either use where column = "" or {if: row.column = ""} to generate the logic. Here is the example to select rows which are empty

{dbselect: SELECT Name, Custom FROM Table1 where Custom = ""; space=id; menu=yes}

Or

{dbselect: SELECT Name, Custom FROM Table1; name=data; space=id; multiple=yes}
{repeat: for row in data}{if: row.custom = ""}
{=row.name}{endif}{endrepeat}

1 Like

Thanks Vinod! So I am actually curious to know if there is a command for TB to insert whatever is in the column, as long as it is not blank.

I know that typically I can just insert the variable, but in this case, I am creating a bulleted list, and for the other fields an if/else command works, because the typical entries into these fields/columns will be standardized. But with the custom field (inspection clause), there could be any type of answer submitted.

So for example:
In the snippet example below, I am using if/else for all the other variables, to determine whether they are inserted, which also determines if there is a an extra bullet point added.

Is there some way to tell Textblaze, that IF the "inspection clause" column, has anything in it, to then insert that text? Thank you

image

Thank you :grinning:

Hi @ajduna7,

You can add an if-condition to check if the ‘inspection clause’ is not an empty string. I have provided a sample snippet for illustration.

{note}{formtext: name=inspection clause}{endnote}{if: `inspection clause` <> ""}

  • {=`inspection clause`}{endif}
1 Like

That worked perfectly - Thank you Ashwin!!

1 Like