Get XML source of any object in adobe via JSAPI | Community
Skip to main content
Marcel_Szimonisz
Community Advisor
Community Advisor
December 14, 2016
Solved

Get XML source of any object in adobe via JSAPI

  • December 14, 2016
  • 4 replies
  • 4719 views

Hello all,

is there any JSAPI function or a way to get the XML source of any object within adobe campaign as if you would display it in the console client?

 

Kind regards,

Marcel

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by florentlb

Hello Marcel,

You can use toDocument and toXMLString functions. For example to retrieve a specific workflow: 

var wf = NLWS.xtkWorkflow.get(18846582); logInfo(wf.toDocument().toXMLString());

Hope this helps,

Florent

4 replies

florentlb
florentlbAccepted solution
Level 10
December 15, 2016

Hello Marcel,

You can use toDocument and toXMLString functions. For example to retrieve a specific workflow: 

var wf = NLWS.xtkWorkflow.get(18846582); logInfo(wf.toDocument().toXMLString());

Hope this helps,

Florent

Marcel_Szimonisz
Community Advisor
Community Advisor
December 15, 2016

Thank you very much. This was exactly I was looking for. I have another question tough: where can i get the latest JSAPI help file as I mine is from 2013  :)

I have used this to get all workflows which use a particular list:

var query = xtk.queryDef.create( <queryDef schema="xtk:workflow" operation="select"> <select> <node expr="@id"/> <node expr="@label"/> <node expr="@internalName"/> </select> </queryDef> ) var res = query.ExecuteQuery(); var adobeId = 192400121; for each (var w in res.workflow){ var workflow = xtk.workflow.load(w.@id); if (workflow.toDocument().toXMLString().indexOf(adobeId) != -1) logInfo(w.@internalName + ";" + w.@label); }

 

Thank you,

Marcel

florentlb
Level 10
December 15, 2016

Latest JSAPI versions should be available on the Download Center of the support portal. But as they are under license, it may be necessary to ask Support to give you the necessary rights (if you are eligible) to see it.

Florent.

Level 2
May 11, 2017

On a related note, you can get the structure of tables through the SOAP API - here's an example for a table 'foo':

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:xtk:queryDef">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:ExecuteQuery>
         <urn:sessiontoken>...my token...</urn:sessiontoken>
         <urn:entity>
<queryDef operation="select" schema="xtk:srcSchema"  >
    <select>
        <node expr="@mappingType"/>
    </select>
    <where>   <!-- here's how to get a specific table structure details -->   
      <condition expr="@name = 'leadListDetails'"/>    
    </where> 
</queryDef>
         </urn:entity>
      </urn:ExecuteQuery>
   </soapenv:Body>
</soapenv:Envelope>

Note that the 'queryDef' node is a child of <urn:ExecuteQuery><urn:entity>