Simple Update to Date Field

Options

Hello,

This feels like it should be very easy, but I cannot get this step to work as intended. I'm trying to update our onboarding workflow to allow our internal administrators to update the worker start date if they are aware of a change to the start date.

I've added the step configuration as an attachment.

This step is preceded in the workflow by a task assigned to our internal administrators where they are optionally able to provide an updated worker start date in the {{updated-start-date}} field.

I configured this step to be conditional on {{updated-start-date}} is not empty. The intent is to update the value of {{start-date-formatted-for-emails}} to the value of {{updated-start-date}} if {{updated-start-date}} has a value. I believe my issue is somehow related to the 'Output field value'. I've referenced the {{updated-start-date}} field as the value to be used in the 'Output field value'. However this step just won't fire as configured. If I type in a hard coded date (12/31/2021 for example), this step does fire and successfully assigns the value of 12/31/2021 to the {{start-formatted-for-emails}} field.

Why won't it fire on the dynamic value of the {{updated-start-date}} field but will fire on a hard coded date?

Thank you,

Jeff

Best Answer

  • Chuck_146211
    Chuck_146211 Posts: 36 admin
    Answer ✓
    Options

    Hi @Jeff_196484,

    Here's one way to get around this. While this is not the most ideal solution, I have been able to test with consistent results.

    I added a 'Dates: Format a date time' action before the 'Dates: Set value of a date field' action. This formats the {{updated-start-date}} to YYYY-MM-DD. I then use this formatted date as the 'Output field value' in the 'Dates: Set value of a date field' action.

    You would then have to re-format the {{start-date-formatted-for-emails}} field after this. It's a bit of a bulky workaround.

    Another route that may be useful is to conditionally display text in emails. This uses IF/ELSE conditional logic you can configure in the body of the email.
    Your email body field may look something like this:

    Hi {{candidate-name}}, your start date is {{#if updated-start-date}}{{updated-start-date}}{{else}}{{start-date-formatted-for-emails}}{{/if}}


    Formatting {{updated-start-date}} to YYYY-MM-DD

    Setting value

Answers