Skip to main content
Solved

fme json template

  • Feb 19, 2014 10:11 PM UTC
  • 3 replies
  • 91 views

Forum|alt.badge.img
In this article you show how to create a JSON template from attributes,

 

 

http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Transformers/jsontemplater.htm

 

 

But I have some values that are in Published Parameters. How would I get those?

 

 

I don't see an XQUERY request for that:

 

 

http://docs.safe.com/fme/html/FME_Transformers/Default.htm#XQuery/XQuery_functions.htm

Best answer by dr_ysg

I got an answer from De Wet van Niekerk @ SAFE support:

 

 

This isn't exactly XQuery, but you can use the standard FME macros, such as $(PUBLISHED_PARAM_HERE), and it will work in the JSONTemplater. Here's a screenshot of how it is inserted into the template: http://screencast.com/t/MiKC2GzlU

 

 

 

View original
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.

3 replies

fmelizard
Safer
Forum|alt.badge.img+22
  • Safer
  • Feb 20, 2014 8:13 AM UTC
Hi,

 

Have you tried feaching them with the ParameterFetcher?

Forum|alt.badge.img
  • Author
  • Feb 20, 2014 2:14 PM UTC
The Parameter already exists in the workspace, but I did see that I could use the AttributeCreator and then fill in the value from the Published Parameters. Now my issue (minor) is that the values are all quoted strings, even booleans as well as integer and float values. But it is a minor issue for the Node.JS server that I have written.

 

 


Forum|alt.badge.img
  • Author
  • Best Answer
  • Feb 24, 2014 3:02 PM UTC
I got an answer from De Wet van Niekerk @ SAFE support:

 

 

This isn't exactly XQuery, but you can use the standard FME macros, such as $(PUBLISHED_PARAM_HERE), and it will work in the JSONTemplater. Here's a screenshot of how it is inserted into the template: http://screencast.com/t/MiKC2GzlU