Suppose that I am building a timesheet and I add (through a form) an Employment of a Person on a Project from Week x to Week y for z hours each week.
The Allocation table has Person, Project and Week as key, so the employment "from week x to y" reflects multiple entries: as many as the number of weeks involved.
I did not find a clear way to do this and I thought about triggering events based on something that would happen on an auxiliary table, but I am struggling with finding a possible solution...
Any hints? Thank you a lot!
Thank you for your question and welcome to the community.
For time tracking apps, we have a prebuilt template that can be modified according to your needs. It allows admins to add a week/weeks to the timesheet. For more information, see Timesheet Template
I hope you find this useful.
Thank you @Pankaj ,
unfortunately, that app shows a way to add a single entry with a multiple week span, but I was wondering if it exists a way (direct or not) to have a multiple week selection for an employment that adds (in the full table) an entry for each week in there (as weeks are referenced through their table and identified with an unique ID): if Ann words on Proj1 from 06/14/2021 until 06/25/2021, I will see Ann on Proj1 in Week X (06/14/21 to 06/18/21) and Ann on Proj1 in Week Y (from 06/21/21 to 06/25/21).
Weeks table that manages five days from Monday to Friday is already there, what I am struggling with is an 'engine' that allows the creation of multiple unique identities starting from a single insert in another table!
I am glad to hear from you.
Currently, there is no direct way to accomplish this.
Using automation can help you achieve the functionality. Use functions like WEEKDAYS() or DAYS() to calculate how many weeks are between two dates. Then, use some automation to split the weeks those are between the two dates.
Feel free to reach out to us if you have further questions.
Currently, I am working on this solution:
An Auxiliary table contains Employer ID, Job ID, start week code and end week code.
A first automation listens for rows added in the table linked to the form and creates the row in the Auxiliary table and the first row on the 'final' Employment table.
Then another automation listens for adds in that final Emplyoment table and adds another row in it (enabling recursion) that only differs in the week ID (incremented by 1). This until (run option) I have reached the ID of the final week in the Auxiliray table.
I've read that Honeycode blocks some automation loops to avoid infinite row generation, but this one is always controlled. I hope that it works...
The method I wrote above doesn't work... No more than a "self-loop" automation occurs. I guess that if I extend that logic by bouncing between two tables (listening for and triggering each other's row inserts) things won't change... Would they?
Unfortunately, I didn't understand the workaround you suggested...
Thank you for responding back. I found a community post that resonates with your question. I recommend that you review automatically-add-rows-with-data-if-condition-is-true.
Additionally, if you want to learn more about automation, check out the following links:
Hi @Pankaj ,
thank you for answering! Yesterday, minutes after I wrote my last comment, I found that exact same topic and... it works
Now I'm implementing a multiple deletion on that table, based on an equality condition on another table, I think that this way of using filters to handle multiple rows should suit too!
That's great news @Fran-ab92! Glad you found it and that it was helpful