Retrieving AEM content path from AC | Community
Skip to main content
Level 3
July 23, 2025
Solved

Retrieving AEM content path from AC

  • July 23, 2025
  • 1 reply
  • 334 views

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.

Best answer by NiteshPandey

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.

1 reply

NiteshPandeyAdobe EmployeeAccepted solution
Adobe Employee
July 24, 2025

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.
rntrpAuthor
Level 3
July 24, 2025

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?

ccg1706
Community Advisor
Community Advisor
July 27, 2025

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