Workflow error in dateTime

Hi,

I trying to add 10 additional days from certification activated date and to set that as due date.
I’m receiving the below error while testing my workflow, pasting my step input.

{
  "variables": [
    {
      "name": "TESTING",
      "transforms": [
        {
          "id": "sp:transform:addTime:time",
          "input": {
            "length": 10,
            "type": [
              "string"
            ],
            "unit": "days"
          }
        },
        {
          "id": "sp:transform:concatenate:string",
          "input": {
            "type": [
              "string"
            ],
            "variableB": "_Test"
          }
        }
      ],
      "variableA.$": "$.trigger.campaign.modified"
    }
  ]
}

Error => addTime transform: variable A must be valid sp:transform:addTime:time must be in ISO8601 format

Hi @chandramohans27,

Currently there is an issue with using two operator in single “Define Variable”. I would suggest you to create multiple “Define Variable” to accomplish the requirement.

Here’s more information on the issue:

@atarodia

I’m using single operator “DEFINE VARAIBLE” to add 14 days to the campaign modified date. but it throws the following error in workflow testing.

error :

Hi @chandramohans27,

I am assuming the trigger you are using is “Campaign Generated”, in that scenario the modified date can be null. Is there any reason you are using the modified date and not created date.

Could you please confirm if modified date is not null

@atarodia

I’m using “Campaign Activated” as my trigger.

My requirement is to check for campaign activated date and to add 14 days and keep that in a variable. I dont see any attribute like activated date, hence i’m using modified date, considering thats going to be same when the campaign activated is triggered.

i will be using that variable to set my new deadline to the campaign

Hi,

I just tested this and it is working fine for me.

The reason you are getting this error is because when you are testing the workflow, you are giving the modified attribute null value. When the workflow actually runs, the modified is not null and the date of activation will come.

Try this as workflow test input:

{
  "campaign": {
    "id": "2c91808576f886190176f88cac5a0010",
    "name": "Manager Access Campaign",
    "description": "Audit access for all employees.",
    "created": "2021-02-16T03:04:45.815Z",
    "modified": "2023-07-15T03:04:45.815Z",
    "deadline": "2021-03-16T03:04:45.815Z",
    "type": "MANAGER",
    "campaignOwner": {
      "id": "37f080867702c1910177031320c40n27",
      "displayName": "William Wilson",
      "email": "[email protected]"
    },
    "status": "ACTIVE"
  }
}
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.