Skip to main content
Question

create a json file from an excel file

  • November 8, 2013
  • 2 replies
  • 27 views

Hello,  

 

l'm attempting to create a json file using a json existing file structure, with values coming from an excel file.

 

(I didn't find example with json file not in input).

 

My problem is that l want to fill json file only with key:value not null (as you can do in php..?) so that the key is not written in the json file.

 

sorry for my bad english, this an example : 

 

if l managed to get from my excel file :

 

title_fr : description in fr --> title templater  "fr" : getattribute("title_fr"),

 

title_en : null --> "en" : getattribut("title_en")

 

In my title objet in the json file, l want : 

 

title

 

{

 

 "fr" : "description in fr"

 

}

 

and not

 

title 

 

{

 

 "fr" : "description in fr",

 

 "en" : ""

 

}

 

in order to have a clean json file especially when l expect to have a lot of null values depending of the case.

 

 

Hope l was enough clear for you to help me!!

 

thanks, 
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.

2 replies

david_r
Celebrity
  • November 8, 2013
Hi,

 

 

you could try to insert an NullAttributeRemover from the FME Store before you create your JSON output.

 

 

David

  • Author
  • November 14, 2013
Thanks for your answer, but this can't work. I put my attributes in a json templater, and that way nullattributeremover can't remove it...