Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards

Retrieving AEM content path from AC

Avatar

Level 2

How do I query the AEM content path associated with a delivery. I understand this might be a javascript code. What should go in this code? So far all I have is a simple workflow with a query object that is just querying for 1 delivery Id against the delivery schema. I am outputting the delivery Id in the query result.

3 Replies

Avatar

Employee

Hi @rntrp 

Here is a typical code snippet you would use in a JavaScript activity after your initial query (assuming your workflow variable vars.deliveryId holds the queried delivery ID):

// Load the delivery record by its ID
var dlv = NLWS.nmsDelivery.load(vars.deliveryId);

// Read the linked AEM path
var aemPath = dlv.remoteContent.@remotePath;

// Output to the workflow journal for visibility
logInfo("The AEM path for Delivery " + vars.deliveryId + " is: " + aemPath);
  • If you want to use this path in the workflow further, assign it to a workflow variable:
vars.aemPath = aemPath;
  • NLWS.nmsDelivery.load(id) is the standard API to load a delivery schema object by ID.
  • The @remotePath attribute gives you the path to the linked AEM content.

Avatar

Level 2

Thanks @NiteshPandey for your response. That was super helpful. I want to build on this use case. Now that I have the path, is there any way to retrieve the actual content via AC workflow?

Avatar

Community Advisor

Hi @rntrp,

 

You can retrieve the content using a JS activity with an HTTP request to the AEM API, once you have the AEM path. Take into account that you will need to have network access to AEM and be able to manage authentication if it is necessary.

 

Best, 

Celia