Question

create a json file from an excel file

  • 8 November 2013
  • 2 replies
  • 2 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, 

2 replies

Userlevel 4
Hi,

 

 

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

 

 

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

Reply