Adding a row for each day between two dates

Hi all

Iโ€™m curious if this is possible.

We do track our work times with AppSheet. Employees enter a Start Timestamp and End Timestamp to track how long they worked for a project in a day.

Now, if they have holidays, they need to add each holiday day seperatly.

Is it possible to create a form, where an employee chooses a start and enddate, and AppSheet adds a row for each day (except weekends) to a table?

Thanks in advance.
Adrian

0 8 896
8 REPLIES 8

I believe that is technically possible now with the AppSheet automation feature. You could create a daily Schdule Bot to run say every day at 1:00 AM that adds new records for all those tasks where the bot runs where the day of run is greater than or equal to [Start Date] and less than or equal to [End Date]. So the bot would add new records on a daily basis for all open tasks rather than adding all records at once till the end of the respective task.

So the schedule bot runs a process of Run a Task โ†’ Change Data โ€“ > Add New Rows.

While creating the first task first time, the employee could define start and end dates. And the daily bot will copy certain fields ( Say task name and description, the project name etc) to create a new row each day.

However, @prithpal or someone from the AppSheet automation team or other community colleagues may opine on the suitability of adding a high number of rows on a daily basis this way using automation. I tested have the concept wherein I conditionally add around 3 or 4 rows. Also, I ran the schedule bot in test mode as my test app was not deployed.

Tricks from @Steve with some alternation to add condition to determine if or not weekdays could achieve a goal?

Thanks a lot for your solution and sorry for replying so late.

So I just tried out this solution, as it looks like what I need.

Unfortunately, when I enter the dates into the controll table and then click on Action Number 1, the App stops working and doesnโ€™t respond. Is it possible to find out, where the actions are not working correctly?

Thanks in advance.
Adrian

The behavior you describe is typically because part of the configuration was omitted or entered wrong. Please review the entire documented process and ensure it is implemented in its entirety.

Yes, tricks from @Steve surely works. If not, something wrong with App Settings.
When the app starts to freeze during set up for such type of looping stuffs, it is a good indication that the actions are in inifinite loop, so the app freezes, based on my past experiences.

Thank you both tsuji and steve.

I tried to rebuild the sample app and now got it to work. I donโ€™t really understand how Steve automated the actions (without having to click on the Action 1 in the app) but thatโ€™s not really a problem.

What I now have trouble with is, where and how to check if its a weekday or weekend, and how to not create a row if the day is on a weekend.

Any solutions there?

Thanks for the links, altough I know about them. The problem is, where to place the code in the app. Which action to attach it to. Also how the syntax should look like exactly. Iโ€™m really not coming from a programmer background, so sorry if those are some rookie questions.

Anyway, I will give it a try and see if I maybe can find this out.

Top Labels in this Space