Get XML source of any object in adobe via JSAPI

MarcelSzimonisz

MVP

14-12-2016

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

Accepted Solutions (1)

Accepted Solutions (1)

florentlb

15-12-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

Answers (3)

Answers (3)

blair_elzinga

11-05-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>

florentlb

15-12-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.

MarcelSzimonisz

MVP

15-12-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