Hello there!
I have a time picker (I use 4 dropdowns for this) https://gyazo.com/c560a3ab9869a24df2fc1f4b239616a5
Now whenever the editmode is new, we need to do the following:
Database lay-out: https://gyazo.com/33df7a1969c3f7127026060e5410beb4
1. Filter it on the current user that is using the app. We will do this with their fullname. I have set a variabele named varcurrentuser to the users fullname. We can use this variabele to filter. The fullname of varcurrentuser should be equal to the column "Werknemer"
2. After that we need to check if there are any tickets on the day of today (On the screenshot of the lay-out for the database this is 26/08/2020). If there are, take the latest filled in TijdEind. This column is not shown in the screenshot of the database because it doesn't fit, here is a screenshot: https://gyazo.com/e4fe4c2b214c31fe766157687c65c037
3. Example:
I made 2 tickets, 1 on 26/08/2020 and 1 on 25/8/2020 (https://gyazo.com/895a8eb463407f6172bd954e53a66e41)
Here are the times: https://gyazo.com/b651e8716e3c1cb9ac47c8346e641e86
If today is 26/08/2020, it should take the 15:00 and fill it in all of these 4 dropdownboxes. If its the next day (27/08/2020) and there are no tickets, the default should be "00".
Here is the code I am using right now. This just sets the default value to "00", if in editmode, it is the first 2 numbers of tijdbegin. If the mode is not new, this code should stay (The left function):
If(
EditForm1.Mode = FormMode.New;
"00";
Left(
ThisItem.TijdBegin;
2
)
)
We might be able to use the code I have used to filter my gallery on the users full name & current day
Filter(
UrenRegistratie;
Datum = Text(
Today ();
"dd/mm/yyyyy"
) And varcurrentuser = Werknemer
)
How can I do this?