Solved

Paste aggregator result into JSON attributes

  • 7 February 2019
  • 2 replies
  • 1 view

Hello,

I'm new to FME and I'm looking to get a JSON file formatted like this :

{
    "depart": {
        "INCENDIE" : 533,
        "AUTRES" : 30,
        "RISQUES TECHNOLOGIQUES" : 71,
        "OPERATIONS DIVERSES" : 320,
        "ACCIDENT" : 411,
        "SECOURS A PERSONNE" : 3813
    }
}

The data comes from the following treatment : 

0684Q00000ArCqvQAF.png

And the inspector give me that informations :

0684Q00000ArCpTQAV.png

 

I've try to use the following treatment :

0684Q00000ArCYRQA3.png

 

With that configuration : 

0684Q00000ArCUPQA3.png

 

0684Q00000ArCsZQAV.png

 

0684Q00000ArCmaQAF.png

 

0684Q00000ArCseQAF.png

 

0684Q00000ArCsjQAF.png

 

But I can not get the desired result as above.

If anyone could help me ...? 

 

Best regards.

icon

Best answer by takashi 7 February 2019, 16:31

View original

2 replies

Userlevel 2
Badge +17

This workflow might help you.

Root Template:

{
    "depart" : {|
        fme:process-features("SUB")
    |}
}

SUB Template:

{fme:get-attribute("MOTIF_DEPART") : fme:get-attribute("VAL")}

0684Q00000ArLMYQA3.png

Thanks a lot, i get the expected result now.

 

Best regards !

Reply