Combine seperate field numbers to be a date

Hi,

I have 3 separate number fields returned from an API. Year, Month and Day

  • yyyy
  • mm
  • dd
    any idea on how I can combine these number fields into a single date field?

Thanks, Cyril

Hey @cyriltdixon

Sure, so you’ll need to create the date field where we’re save the value from the 3 combined values - I’m going to assume that these values from the API are sent as numbers, if they are text values, you can use the :converted-to-number expression so they evaluate to a number rather than plain text.

Anyhow to achieve this you’ll be best using the ‘current date expression’ to generate a date, then modifying using the ‘change x to y’ [x = property and y=returned value of API].
Example:
image

FYI - the :rounded down to date will even this date of to 12:00am (browser time or server time depending where the workflow action runs)

Best to check that the formatting of the values for each the date, month and year comply with the construct expressions when using ‘change month to x’
Docs here:

Hope this makes sense.

4 Likes

Awesome @luke2 work’s brilliant.

Thanks for taking the time to show me how.

1 Like

Very helpful. Thank you!