Skip to main content

Dear FME community.

 

I'm trying to extract, from a json object, the json arrays.

My object looks like :

aAs you can see, I've multiple sub objects and I want to extract this parts :

aaIn this case, I tried to use the transformer jsontemplater but I was stopped by the loop in the json for sub sub object.

In this part I do this :

eeeBut maybe it' not the best method, that's why I need help.

Do you see how can I do this ?

Thank you very much.

In fact, I try to make a loop in a loop in a loop ...

I found this solution :

{
"Attributes":b  for $Age at $pos in fme:get-list-attribute("_list{}.Age")
     let $Date := fme:get-attribute(concat("_list{",$pos - 1,"}.Date"))
     return {"Date":$Date, "Age": $Age}]
}

that work for 1 sub object but for multiple sub object ??

{
"Attributes": Â 
for $Age at $pos in fme:get-list-attribute("_list{}.Age")
let $Date := fme:get-attribute(concat("_list{",$pos - 1,"}.Date"))
return {
"Date":$Date, 
"Age": $Age,
"Sub Attributes": Â 
for $SubAge at $Subpos in fme:get-list-attribute("_list{}.SubAge")
let $SubDate := fme:get-attribute(concat("_list{",$pos - 1,"}.SubDate"))
return {
"SubDate":$SubDate, 
"SubAge": $SubAge,
"SubSubAttributes": 
for $SubSubAge at $SubSubpos in fme:get-list-attribute("_list{}.SubSubAge")
let $SubSubDate := fme:get-attribute(concat("_list{",$pos - 1,"}.SubSubDate"))
return {
"SubSubDate":$SubSubDate, 
"SubSubAge": $SubSubAge,
}
]
}
]
}
]
}

 

 


Can you share your sample json as text rather than a screenshot?


Thanks for your reply @ebygomm​ I've data extract join in this post :-)


Reply