Question

Replace null values in JSONTemplater

  • 20 July 2020
  • 1 reply
  • 9 views

Badge

I currently have a template like this:-

    {
    "pd_id" : fme:get-attribute("pd_id"),
    "name":fme:get-attribute("district_name"),
    "code" :fme:get-attribute("district_code")
    }

 

 

Is it possible to add a rule that says: IF district_name is null then name = fme:get-attribute("pd_id")


1 reply

Userlevel 2
Badge +17

Hi @davebarter, I think it would be easier to change the value of district_name to the value of pd_id if it was null, using an AttributeManager with Conditioinal Value setting before the JSONTemplater.

Reply