If embedded subs exists then...

Support for macOS users
Post Reply
jchh
Posts: 45
Joined: 02 Nov 2020, 15:13

If embedded subs exists then...

Post by jchh »

Hi,

Can I do something like the following?

Code: Select all

{textLanguages == undefined ? null: " $textLanguages.ISO2" }
I realise that 'undefined' does not work, neither does 'null'.
Is there a way?
thanks!
jchh
Posts: 45
Joined: 02 Nov 2020, 15:13

Re: If embedded subs exists then...

Post by jchh »

OK, for anyone that is interested, this appears to work:

Code: Select all

{textLanguages ? " $textLanguages.ISO2" : null }
User avatar
rednoah
The Source
Posts: 22854
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: If embedded subs exists then...

Post by rednoah »

:idea: {textLanguages} is never null or undefined, because it will throw an error instead. See Learn how {expressions} work and useful Helper Functions for details.

:arrow: You can thus just do this:

Format: Select all

{ ' ' + textLanguages.ISO2 }
:idea: Please read the FAQ and How to Request Help.
jchh
Posts: 45
Joined: 02 Nov 2020, 15:13

Re: If embedded subs exists then...

Post by jchh »

Just seen this - thanks!
Post Reply