XML load data issue

I am loading data from XML file

I made UNWIND for all GraphicELements as graphicElement

But I have an issue with UNWIND , all Embedded symbols have custom properties as child but some of the doesn't have SubstituteStrings and some doesn't have OverriddenWizardOptions and some have only custom properties

So when I use this query :
UNWIND [x in graphicElement._children where x._type = 'SubstituteStrings'] as SubstituteStrings

then i use this query :
UNWIND [x in graphicElement._children where x._type = 'OverriddenWizardOptions'] as
OverriddenWizardOptions

the graphicElement won't have any children with type OverriddenWizardOptions

Yeah, you can't use back-to-back 'unwind' statements, since the first one without any data will terminate the query. You could use call subqueries if you don't need to return values.

//other cypher before
call {
    with graphicElement
    UNWIND [x in graphicElement._children where x._type = 'SubstituteStrings'] as SubstituteStrings
    //process 'SubstituteStrings'
}
call {
    with graphicElement
    UNWIND [x in graphicElement._children where x._type = 'OverriddenWizardOptions'] as
OverriddenWizardOptions
    //process 'OverriddenWizardOptions'
}
1 Like

Your solution worked for me as usual

Thanks alot

1 Like