extract the date that is part of the name for the “dateofcreation”
one thing that will really help me is to get the week number for the “dateofcreation”
Please share the workflow
Node 1 : NumWeek of this week (set node with {{$today.toFormat('WW')}} for expression
Node 2 : the drive node
a/ Get the file list based on my filter with their names
Objects to split in node 2: #MATRIX COPIL 33 agenda Sun Nov 20 2022 18:00:00 GMT-0500 (Eastern Standard Time) #CQI2022 COPIL 8 Tue Nov 22 2022 00:00:00 GMT+0100 (Central European Standard Time) #GED2023 Copil 10 Mon Nov 21 2022 18:00:00 GMT-0500 (Eastern Standard Time)
Node 3 : Set week number for the file
Node 4 : IF week number comparaison
a/ create an If node to keep only files with the same weeknumber of the current one ({{DateTime.now().toFormat("WW");}})
Node 5 : Gmail draft
a/ Create a email draft with the link of the file location and other JSON item
the flow is not yet created as i 'm stuck with the node 2 i’m not dev. and don’t know how to handling it.
Many thanks for your help
Information on your n8n setup
n8n version: n8n Version 0.182.0
Database you’re using (default: SQLite): google drive
Running n8n with the execution process [own(default), main]:
Running n8n via [Docker, npm, n8n.cloud, desktop app]: desktop app
' split each string separated by space
const parts = item.name.split(' ');
for (let i=0;i<parts.length;i++) {
item[`var${i+1}`] = parts[i];
}
return item;
Use a Rename Keys node to define the proper json.item
for the : one thing that will really help me is to get the week number for the “dateofcreation”
I won’t use it because the only solution i have is to merge the items of the date and reformat it as date then do comparason with a set node with expression {{$today.toFormat('WW')}}
Hi @terryble66, great to see you’ve figured it out and thank you so much for sharing your solution
Did you solve the getting the week number from your dateofcreation value as well? If not, something like below could do the job I think:
I am using a regular expression here to extract the date and time, then parse it using Luxon’s fromFormat (since it didn’t seem to match any standard format supported by Luxon). The expression could use some tweaking I think, but the basic idea should work.