How to simplify IF( IFEMPTY() ; EMPTYSTRING ; "hello world") function?

Hello Makers, I often need to show/hide content if a variable exist/doesn’t exist. I tried several things and my last idea was :

{{if(
ifempty(1.data.`intervention-payer-type`; true) = true; emptystring; "
PAYEUR
Type de payeur : " + 3.`Type de donneur d'ordre` + "
Société du payeur : " + 1.data.`Company Name`)}}

It sounds quite complex to do something quite simple. Do you have any alternative to make it “more beautfiul” ?

Best,

Screenshot :

Hi @Garry_V,

So when intervention-payer-type is empty, show nothing, if it has a value, show:
PAYEUR
Type de payeur : " + 3.Type de donneur d’ordre + "
Société du payeur : " + 1.data.`Company Name```

Is that correct?

Generally, it is not needed to mix the ifempty and if functions. You can achieve the outcome with only the if function:

{{if(1.data.`intervention-payer-type` != emptystring; "PAYEUR
Type de payeur : " + 3.`Type de donneur d'ordre` + "
Société du payeur : " + 1.data.`Company Name`; null)}}

Result:

Cheers,
Henk

1 Like

Thank you @Henk-Operative And sorry about my stupid question, I realized how easy it was and how blind I got :blush:

1 Like

Not a stupid question at all! Happy to hear this worked out for you.