Skip to main content
Question

Replace null values in JSONTemplater

  • July 20, 2020
  • 1 reply
  • 39 views

Forum|alt.badge.img

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")

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • July 20, 2020

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.