Expand my Community achievements bar.

SOLVED

Get XML source of any object in adobe via JSAPI

Avatar

Community Advisor

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

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

Avatar

Community Advisor

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

Avatar

Level 10

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.

Avatar

Level 2

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>