Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards

Add Default Script to 'Delivery' form in 'Workflow (xtk)' input form

Avatar

Level 3

Hi,

 

We would like to add a default value for the 'script' container within the 'delivery' form as defined in 'Workflow (xtk)' input form, as shown below:

 

Screenshot 2025-08-28 120730.png

 

How can we get a string to populate in the delivery script automatically whenever the delivery activity is chosen?

 

Thanks,

Skyler

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

5 Replies

Avatar

Level 2

Hey @SkylerQu2,

 

Unfortunately, there’s no supported way to auto-fill the script field in a Delivery activity via the input form. Because the script uses a rich text/code editor, it doesn’t accept default or defaultValue attributes, and injecting XML defaults won’t apply when the activity is added.

The only reliable option is to set your default script inside the delivery template itself. That way, whenever users select that template, the script is pre-populated.

 

Thanks,

Avatar

Level 3

Hi @Rch_  is there a way to add a custom script to the out-of-the-box delivery activity that will run when the workflow activity is executed?

Avatar

Level 2

@SkylerQu2,

 

Would you mind sharing a bit more about what you’re trying to do with the custom script in the delivery activity? For example — is the goal to modify the delivery content, control when it sends, apply some logic to recipients, or something else?

Once we understand the use case a little better, we can figure out whether a typology rule, JS activity, or some other approach makes the most sense.

Happy to help once we see the full picture.

Thanks,

Avatar

Level 3

Hi @Rch_ 

 

Deliveries using the 'star' delivery action (see screenshot) do not get associated to the campaign from which they are created

Screenshot 2025-08-29 132441.png

So, recipients in broadLogRcp for deliveries created using this action do not have a campaign associated with them by default.

 

To make that association, we add the following code to the 'Script' tab of the delivery activity:

delivery.operation_id = instance.operation_id;

SkylerQu2_1-1756488398618.png

 

We would like to include this javascript code in the activity by default so that the association does not rely on users adding this piece of code to the delivery activity themselves.

 

We have use cases for the star delivery, so using other delivery actions is not an option here, unfortunately.

 

Thanks,

Skyler

Avatar

Community Advisor

Hello @SkylerQu2,

 

What can meet your need is to set a default value to the ''script'' of the ''star'' delivery activity.
To do this, you need to extend the xtk:workflow schema (or, if you have already extended the schema for another purpose, use the same extension) and add this piece of XML:

 

  <element name="delivery">
    <element name="script">
      <default>'delivery.operation_id = instance.operation_id;'</default>
    </element>
  </element>

 it should look like this :

Amine_Abedour_0-1756587491426.png

 

After that, clear the local cache, reconnecte, and test adding a new delivery activity to a workflow. It is working on my end.

Enregistrement 2025-08-30 230302.gif

Br,