Skip to main content
Solved

Paste aggregator result into JSON attributes


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.

Best answer by takashi

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

View original
Did this help you find an answer to your question?

2 replies

takashi
Influencer
  • Best Answer
  • February 7, 2019

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 !


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings