Skip to main content
I am using the JSONTemplater with such Root Expression:

 

 

{

 

    "Code" : fme:get-attribute("Code"),

 

    "Nom" : fme:get-attribute("Nom"),

 

    "C3" :

 

        >

 

          {

 

            "label" : "2006",

 

            "value" : fme:get-attribute("C3_EII06")

 

        },{

 

            "label" : "2007",

 

            "value" : fme:get-attribute("C3_EII07")

 

        },{

 

            "label" : "2008",

 

            "value" : fme:get-attribute("C3_EII08")

 

        },{

 

            "label" : "2009",

 

            "value" : fme:get-attribute("C3_EII09")

 

        },{

 

            "label" : "2010",

 

            "value" : fme:get-attribute("C3_EII10")

 

        },{

 

            "label" : "2011",

 

            "value" : fme:get-attribute("C3_EII11")

 

        }

 

     ]

 

}

 

 

The "values" in the C3 list are all float attributes but the Templater populated them with quotes in the output json. Why? How can I ensure the values to stay in float format?
Update to my question:

 

 

I look into the Input Feature Type into the User Attributes tab and all attributes are in float Type. However, I do put an Inspection Point on the connection between the reader and the JSONTemplater and I see that all attributes have (string) beside them. Does it means that they are already converted into the string type from the reader?
Hi,

 

 

have a look here: http://fmepedia.safe.com/AnswersQuestionDetail?id=906a0000000clKgAAI

 

 

David
Thank you David

It doesn't look like that link goes to a specific entry on fmepedia. Perhaps an updated URL?


Reply