Forum Documentation Showcase Pricing Learn more

Auto fill date with parameter from previeus page

Hello,

Im building a app for employee hour registration.
On the employee page i have 5 buttons, (monday, tuesday, wednesday, thursday, friday).

Is it possible to auto fill the date on the hour registration page based on the “day button” the user pressed?

For example, Employee A pushed the button Friday, the hour registration page opens and the date for the registration is auto filled whith the current weeknumber and day 5?. This is very usefull because the employee is not allways registering his/her hours on the same day.

Hope somebody can give me an answer.

Hi, sure you can do this, first create a data field “day” on your User data type (or any other data type) and ensure the field type is number.

Then create 5 buttons, one for each day of the week, then make changes to current user and set the day to the respective number (it needs to be a number so you can do calculations with it).

The number of days to add depends on what the current day of the week it is:


You would create workflows for all 5 days of the week (the 5 Monday to Friday buttons) and actions of all 7 days of the week (Monday to Sunday) because the user could be using the app on a weekend. I showed two examples above if Thursday is clicked and it is currently a Monday or if Thursday is clicked and is currently Tuesday.

You don’t have to necessarily save the “day” to the database like I showed, you could rather send it as a parameter in the URL when you navigate to the hour registration page.

This should give you some direction of where to start. Hope this helps.

Thank you! It works great.