Im working in a project to automatize emails. I have an idea to do it using loops and incrementing the day of the month, but I don´t get how can I connect the loops or increment the date time.
Does everyone would be so kindly to help me in this task?
Hi @ttsk8der , you’ll find it in the “KNIME Expressions” extension, but if you drag the icon from the link below onto a workflow, it should sort out the installation for you. There is also a “Variable Expressions” node too within that extension.
Hi @ttsk8der , can you give a little more information about what you are wanting to do, and what “incrementing of date time” you are trying to achieve. thanks
Hi @ttsk8der , so do you have a constantly running workflow with some kind of delay, and it sends one or more emails each day, and each time it does that, you want it to get the current date?
If you want the current date for the email, then I don’t see a need to use the loop increment. You would on each iteration fetch the current date without having to perform any kind of calculation. Is there some other reason for needing to use the increment?
If you want the current date so that you can include this somewhere in the email, you could use @ArjenEX 's suggestion to use Column Expressions and have it returned into a column, or use the same function in Variable Expressions and have it returned as a flow variable.
Alternatively, the Create Date&Time Range node can be configured to return the datetime, date or time, at execution so it is another possibility. I even have some home-grown date components:
So getting the current date should not be a problem
So where is it that you are stuck? Do you have a basic workflow at the moment that you can show us, or is it the wider issue of building the whole loop that you are having difficulty with?
The following screenshot is just a mock-up and not a suggestion that this is how a production “email sender” would work, but in its basic form, a loop could look something like this:
I just had another idea and yes, I don´t see for what I need date as a loop iterator.
I´m going to show you an example I have. The idea is to read and process a file, then send it as an email automatically.
Recently I discover the “wait” node and now I have more questions.
How can I restart the wait daily (for send an email)?
Is this node the best to send daily emails, or I need loops?
Sorry if I´m being too annoying, I’m learning this by my self for the company and I´m getting confused.
Hi @ttsk9der I added (late) to my previous post a mock-up of a loop which you may not have seen. Here is a slightly refined version. Again it’s just to give an idea of how it might hang together rather than as an actual demonstration
In terms of executing in a loop, this kind of works if you have a dedicated machine that is permanently on and you can just leave running. It’s perhaps not the most efficient mechanism from a resources/energy perspective but it would do the job. Alternatives to this are to run the workflow once per day using a task scheduler (also requiring a dedicated /always on machine), and of course it would be wrong of me not to mention that KNIME do have a commercial (paid for) solution (KNIME Business Hub) that has scheduling facilities, so that would be the better option if your company is in a position to purchase one.
Not a problem continuing to ask questions. It’s sometimes difficult to provide answers until more of the problem has been expanded upon. I hope you manage to get past the “confused stage”