Reference to Date.now in Web Service Connector

I’m setting up the HTTP Operation for Delete and in the body I need to enter a parameter for the time of the termination in the following format:

"terminationDate": "2024-09-10T11:09:22",

How do I do this the easiest way?

Can I use functions like Date.now() directly in the body?

Or is a transform the best way?

Or do I need a rule for this to work?

If you set the attribute as a static type, you can use Velocity, but only the base Velocity functionality. This means we can’t use functions or tools like dateTool.

Instead, you’ll want to use a transform here and have a dateMath transform get the now value in ISO8601 format (with a dateFormat transform to convert to a different format, if necessary).

1 Like

in the “delete” provisioning profile, you can use the Date transform and set a attribute with the date.now. and capture it in the Body with $plan.date$

ez pizi

1 Like

In what format comes the “now” value?

I entered the following in the body:

"terminationDate": "$now$",

but got stuck in the tranform with what I should put as “inputFormat”.

"type": "dateFormat",
    "attributes": {
        "inputFormat": "",
        "outputFormat": "ISO8601"
    },
    "internal": false

according to this documentation the date transform doesn’t support “now” yet:

Sorry, I should have said dateMath, not dateFormat. now automatically comes through as ISO8601.

{
    "name": "now",
    "type": "dateMath",
    "attributes": {
        "expression": "now"
    },
    "internal": false
}
1 Like