Subtracting StartDate from CurrentDate in Workflow | Experience Community
Skip to main content
Question

Subtracting StartDate from CurrentDate in Workflow

  • August 31, 2026
  • 5 replies
  • 46 views

Forum|alt.badge.img+1

Hi,

In Survey Workflow, I’m trying to create a new variable via

Add task → Data formula → Calculated date fields → Relative date/Current date/time & Fixed value/Response/Start date

It keeps throwing the error "${rm://Field/StartDate} does not match format ISO 8601"

I’ve tried rm://Field/StartDate/c & went down  a convoluted pathway of saving StartDate into a different variable first to force ISO format before doing the calculation - this also didn’t work.

I’m simply creating a variable to determine how long it’s been since they started the survey and send an email reminder if its within a certain time-frame.

 

Thanks in advance,

Brendan

5 replies

TusharDalwani
QPN Level 6 ●●●●●●

Hi, you can use the code task and JS function to call dates in ISO 8601 format and then perform any calculations that you may want.


Forum|alt.badge.img+1

Thanks Tushar. I was hoping to avoid JS! Oh well, queue learning curve.


arunxmarchitect
Level 4 ●●●●
Forum|alt.badge.img+8
  • Level 4 ●●●●
  • September 1, 2026

@BrendanStevensonNZ ,

Please use this in your workflow:

Qualtrics Pipe as Full ISO-8601 Format

If you need the current date in a Data Formula task, you can use:

${date://CurrentDate/c}

 

https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/piped-text/piped-text-overview/

 


Forum|alt.badge.img+1

Hi Arun. I tried following exactly that workflow data formula + date field example, including variations on the theme (eg. CurrentDate/c), but it keeps giving the error:

{
  "name": "Actions.ERROR_CODES.SERVICE_ERROR",
  "message": "${rm://Field/StartDate} does not match format ISO 8601",
  "needRetry": false
}

 

Most annoying, this shouldn’t be that hard!

Brendan


Forum|alt.badge.img+1

This worked:

function codeTask() {
    const startDateText = "${rm://Field/StartDate}";
    const startDate = new Date(startDateText);
    const currentDate = new Date();

    if (Number.isNaN(startDate.getTime())) {
        return {
            success: false,
            error: "Invalid StartDate",
            startDateReceived: startDateText
        };
    }

    const elapsedMilliseconds = currentDate.getTime() - startDate.getTime();

    return {
        success: true,
        elapsedHours: Math.floor(elapsedMilliseconds / (1000 * 60 * 60)),
        elapsedDays: Math.floor(elapsedMilliseconds / (1000 * 60 * 60 * 24)),
        startDateISO: startDate.toISOString(),
        currentDateISO: currentDate.toISOString()
    };
}