Solved

JSON Templater - support for boolean values?


Badge +1

Hello everybody,

because of specific demand I have to use JSON templater -> TXT writer workflow. But, when I need to export values true/false as boolean data type, JSON templater still put me there quotation marks for values true/false - so result is "True" or "False".

Please, has anybody idea, how to figure it out to write bool values without quotation marks?

Thank You so much!

Lubo

icon

Best answer by takashi 2 July 2019, 15:08

View original

4 replies

Userlevel 1
Badge +18

Can you share the template you are using?

Userlevel 2
Badge +17

If a feature attribute (e.g. called "attr") stores 1, 0, "true" or "false", this template expression converts the value to a boolean value - true or false without quotations.

{
    "attr" : xs:boolean(fme:get-attribute("attr"))
}
Badge +1

If a feature attribute (e.g. called "attr") stores 1, 0, "true" or "false", this template expression converts the value to a boolean value - true or false without quotations.

{
    "attr" : xs:boolean(fme:get-attribute("attr"))
}

@takashi Thank You so much!

Badge

Thank you takashi!

Reply