cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bakhita
Regular Visitor

Overtime Request with In & Out

Hi, I am creating an overtime request form with "Overtime In" and "Overtime Out" buttons.

Overtime Request Form.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

Here's how the employee will use the form:

1. Employee will fill out the required info and click "Overtime IN". The current date and time will reflect on the Overtime In data card. An email will notify the supervisor that the employee has started the overtime.

2. Once the employee finished the overtime, he will click "Overtime OUT" and the current date and time will reflect on the Overtime Out data card.

3. The employee will type his requested overtime hours and click "Submit". An email will notify the supervisor and HR that an overtime request is for approval.

 

I've only gotten to the part of setting up the sharepoint list and form as pictured above. 

 

However, I am stuck on how the buttons will work and triggering flows as demonstrated above. I can't seem to see similar powerapps templates I can use as a reference.

 

Your help is greatly appreciated since I am fairly new in creating apps and I would really like to learn how to use it.

 

Data Source: Sharepoint List

SP Overtime Request.JPG

 

 

 

 

SP Overtime Request - Column Types.JPG

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @bakhita ,

Could you tell me when you click "Overtime IN", do you want to update Overtime In data to your list?

If not, where do you want to save the data of Overtime In?

Or do you want to update Overtime In data and  Overtime out data together when you click " Overtime out"?

What's more, what kind of flow that you want to use?

Actually, if you want to send an email after you click a button, you could not use flow. Just using PowerApps is ok.

 

I assume that you want to save all the data together and when you click "Overtime IN", the data will be saved as a variable.

Please notice that in this situation, you need to submit your form before powerapps timeout, or else the Overtime IN variable data will become invalid.

I've made a similar test for your reference:

Please connect with office365 outlook

1)if you use label to display the data of overtime in, please set the label's Text:

var

2)set overtime in button's OnSelect:

Set(var,Now());Reset(DataCardValue10);  //please replace with your label name
Office365Outlook.SendEmailV2(To,Subject,Body)

//then if you click the button, the label will display current time, an email will be sent

Please replace with the email content

Here's a doc about how to use Office365Outlook.SendEmailV2 function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-outloo...

 

3)set overtime out label's Text:

var1

4)

set overtime out button's OnSelect:

 

Set(var1,Now());Reset(DataCardValue11);  //please replace with your label name

 

//then if you click the overtime in button , the label will display the current time

5)set the submit button's OnSelect:

SubmitForm(Form1);Office365Outlook.SendEmailV2(To,Subject,Body)

  //then the form will be submitted, an email will be sent

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
EricLott
Resident Rockstar
Resident Rockstar

You can use Collect() to add an entry to your SharePoint list such as:

Collect(YourSharePointListName,{Title:EmployeeDropDown.Selected.Name,Reason:reasonTextInput.Text,Supervisor:DropDown1.Selected.Name,Pre-approved:DropDown2.Selected.Value})

You can add to it, that should give you an idea.

As for emailing supervisors, that can be seen demonstrated here:

https://powerusers.microsoft.com/t5/Videos/Send-an-email-from-PowerApps/td-p/74349 

v-yutliu-msft
Community Support
Community Support

Hi @bakhita ,

Could you tell me when you click "Overtime IN", do you want to update Overtime In data to your list?

If not, where do you want to save the data of Overtime In?

Or do you want to update Overtime In data and  Overtime out data together when you click " Overtime out"?

What's more, what kind of flow that you want to use?

Actually, if you want to send an email after you click a button, you could not use flow. Just using PowerApps is ok.

 

I assume that you want to save all the data together and when you click "Overtime IN", the data will be saved as a variable.

Please notice that in this situation, you need to submit your form before powerapps timeout, or else the Overtime IN variable data will become invalid.

I've made a similar test for your reference:

Please connect with office365 outlook

1)if you use label to display the data of overtime in, please set the label's Text:

var

2)set overtime in button's OnSelect:

Set(var,Now());Reset(DataCardValue10);  //please replace with your label name
Office365Outlook.SendEmailV2(To,Subject,Body)

//then if you click the button, the label will display current time, an email will be sent

Please replace with the email content

Here's a doc about how to use Office365Outlook.SendEmailV2 function for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-outloo...

 

3)set overtime out label's Text:

var1

4)

set overtime out button's OnSelect:

 

Set(var1,Now());Reset(DataCardValue11);  //please replace with your label name

 

//then if you click the overtime in button , the label will display the current time

5)set the submit button's OnSelect:

SubmitForm(Form1);Office365Outlook.SendEmailV2(To,Subject,Body)

  //then the form will be submitted, an email will be sent

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,623)