Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Nested XML Parser

vishwakar
8 - Asteroid

Hi

 

I am trying to parse the below xml file , I need the relation name and table name from the below , I have tried using XML Parse but could not get the desired results, Any help is appreciated.

 

 

 

<relation join='inner' type='join'>
          <clause type='join'>
            <expression op='='>
              <expression op='[account].[id]' />
              <expression op='[contact].[accountid]' />
            </expression>
          </clause>
          <relation join='inner' type='join'>
            <clause type='join'>
              <expression op='='>
                <expression op='[opportunity].[accountid]' />
                <expression op='[account].[id]' />
              </expression>
            </clause>
            <relation join='inner' type='join'>
              <clause type='join'>
                <expression op='='>
                  <expression op='[pricebookentry].[product2id]' />
                  <expression op='[tproduct2].[id]' />
                </expression>
              </clause>
              <relation join='inner' type='join'>
                <clause type='join'>
                  <expression op='='>
                    <expression op='[opportunitylineitem].[pricebookentryid]' />
                    <expression op='[pricebookentry].[id]' />
                  </expression>
                </clause>
                <relation join='inner' type='join'>
                  <clause type='join'>
                    <expression op='='>
                      <expression op='[opportunity].[id]' />
                      <expression op='[opportunitylineitem].[opportunityid]' />
                    </expression>
                  </clause>
                  <relation name='opportunity' table='[sfdc].[opportunity]' type='table' />
                  <relation name='opportunitylineitem' table='[sfdc].[opportunitylineitem]' type='table' />
                </relation>
                <relation name='pricebookentry' table='[sfdc].[pricebookentry]' type='table' />
              </relation>
              <relation name='tproduct2' table='[sfdc].[tproduct2]' type='table' />
            </relation>
            <relation name='account' table='[sfdc].[account]' type='table' />
          </relation>
          <relation name='contact' table='[sfdc].[contact]' type='table' />
        </relation>

 Thanks

Karthik

11 REPLIES 11
KaneG
Alteryx Alumni (Retired)

Hi @vishwakar,

 

All the macro that I posted did was strip the nesting out. It was just to give you an idea of where to go from there as nesting seemed to be the issue. I have parsed the resulting fields, a little oddly, because of the triple relation in the last nesting. I also included how you would do it using Regex (much easier). 

 

Kane

vishwakar
8 - Asteroid

Thanks @KaneG for taking time and helping me out.

 

Thanks

Karthik

Labels