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
Super User
Super User

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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (3,352)