cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Post Prodigy
Post Prodigy

Re: Making an extra ticket when over 8 hours

Anyone able to help? 🙂

Highlighted
Post Prodigy
Post Prodigy

Re: Making an extra ticket when over 8 hours

I need help with this 😅

Highlighted
Super User
Super User

Re: Making an extra ticket when over 8 hours

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
Highlighted
Post Prodigy
Post Prodigy

Re: Making an extra ticket when over 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 

Highlighted
Super User
Super User

Re: Making an extra ticket when over 8 hours

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,491)