Skip to main content
Solved

JSON Templater float attributes populated as strings

  • October 28, 2014
  • 4 replies
  • 59 views

Forum|alt.badge.img
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?

Best answer by david_r

Hi,

 

 

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

 

 

David
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.

4 replies

Forum|alt.badge.img
  • Author
  • 60 replies
  • October 28, 2014
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?

david_r
Celebrity
  • 8392 replies
  • Best Answer
  • October 28, 2014

Forum|alt.badge.img
  • Author
  • 60 replies
  • October 28, 2014
Thank you David

jnotter
Contributor
Forum|alt.badge.img+5
  • Contributor
  • 18 replies
  • January 28, 2020

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