Skip to main content
Archived

Change the behaviour of the fme:get-list-attribute("") function in a JSONTemplat

Related products:Transformers
  • April 5, 2020
  • 0 replies
  • 18 views

thijsknapen
Contributor
Forum|alt.badge.img+11

***Note from Migration:***

Original Title was: Change the behaviour of the fme:get-list-attribute("") function in a JSONTemplater, to always return an array (not just when the list contains more than 1 element)


I hope the title is already quite self explanatory.

Let me explain with an example.

Consider the following two lists;

Note that list_1 has a single element, and list_2 has two elements.

When I then use the following text in a JSON templater;

I obtain the following result;

{

    "list_1" : "a",

    "list_2" : [ "b", "c" ]

}

Whereas the following addition of square brackets in the JSONTemplater;

does produce the result I would consider to be the the desirable result from the 'fme_get-list-attribute("")' function.

{

    "list_1" : [ "a" ],

    "list_2" : [ "b", "c" ]

}

undesired_behaviour_getList_function_in_JSONTemplator.fmw

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.