Date issue when creating filled in Word Documents

Hi,

A brief outline on what I’m trying to make, we have a site attendance software which gives us a csv file once a week with everyone’s sign in and sign out times and location. I’m trying to make an automated solution that takes this data, organises it, calculates the hours and places it in a word template.

I’ve got as far as putting the details in the fields but I’m completely stuck on a date format issue that I just can’t figure out.

image

This is the format the dates come through as on the CSV, they are set as a “Number” field, this obviously can’t be edited as this is the format it comes in.

From ChatGPT’s guidance I’ve tried to take the field and turn it into a date using formatDate in DD/MM/YYYY so I can put it in the “Date” field on the word doc and then take the time seperate to store as the “sign in time” but I just get constant errors of it not accepting the format, saying it isn’t a date.

Above is the error I get every time I run it,

Would anyone be able to help me with this project and get it complete? I’m new to make so would really appreciate any help.

Thanks

1 Like

Hi @Dylan_Brown Welcome to the community!

When you use parseDate function make sure to use the correct parsing format. For your case it will be D MMM YYYY, HH:mm:ss and if your input date is always with 0 padded in date for single digit date, you can use DD for date, else D is safe side works for both single and double digit dates.

Do one more check about what exactly you are getting in date from csv or sheet as what you can see on screen can be different when you get that in automation. So if you can share your initial input of date data screenshot before parsing, it will be really helpful.

Best,
@Prem_Patel

Thanks for getting back so quickly,

So for example, this is the “signon_at” variable which is mapped to the field within the spreadsheet, so it picks up the correct date/time.

image

This is the formula I’m using to parse the date

So checking the csv, it says it’s in “General” format.

It just doesn’t seem to be changing the field to an actual date field. It’s strange because I’ve tried every sort of date format to.

Thanks