cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimoMigchielsen
Post Prodigy
Post Prodigy

Making an extra ticket when over 8 hours

Hello!

I am having a ticket system where workers can clock-in during their worktime. This is going to be complex and I am not sure if it will be possible. 

 

How the app looks like: https://gyazo.com/c8761eaa962db09ceb8dff502ba24321

You see 2 dropdowns at the start, tijd begin and tijd eind. these are the starting and end times. The textfield tijdtotaal is the formula bases on these 2 dropdowns. It calculates the time between them. 

An employee can work more than 8 hours a day and fill in multiple tickets, because they can work on different projects. 

Whenever tijdtotaal of the day they are wanting to fill in a ticket, is higher than 8, I want it to make a new ticket with the rest of the hours. 

This may be very confusing, it is quite hard to explain. I will give an example now:
https://gyazo.com/38048fc15294d1e52f9a7d18c321e942

On the screenshot above you will see 2 rows (2 tickets) that have been filled in by an employee. You can see the date is  the same of these 2 tickets.

You see the 4,25 and 4,75 which is the column for tijdtotaal. Whenever this column goes over 8, I want to get another ticket and the second ticket should only be going to 8.

So it should like this: 
https://gyazo.com/3c1f4b7173e7a7b36889febea4cbaa2d

It took -1 hours of the second ticket and created a new ticket with ALL the same details, except, this ticket has the 1 hour that went over the 8 hours. 

Just using this code to send the form away: SubmitForm(EditForm1)



I hope I have explained this well enough, if I didn't, let me know and I will try and explain it better. 

 

5 REPLIES 5
TimoMigchielsen
Post Prodigy
Post Prodigy

Anyone able to help? 🙂

TimoMigchielsen
Post Prodigy
Post Prodigy

I need help with this 😅

It would be alot easier to do it through flows. Have you tried that approach? You can have a nested approach in flow and if the hours are above > 8 you can re call the same submissions flow original minus -8 hours

Not exactly what I need with that -8. 

If the first ticket is 5 hours and another one gets created with 4 hours, it will look like this now:

5 hours
4 hours

How it needs to look:

5 hours
3 hours
1 hours

@Rahber 

You would have to use nested branching in flows as i said.

So quick logic here

TotalHours - LastHour = Except Last
if (ExceptLast < 8 ){ ticket 1 = 8 - exceptlast ; ticket 2 = lasthour - ticket1 )
if(ExceptLast > 8 ){
as per logic

sorry its bit crude but it will give you idea where to start

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (979)