Monday, April 4, 2022

How to find Difference between two dates in Hours with calculated fields in Model Driven Apps

Introduction:


In this Blog we will see how to find Difference between two dates in Hours with Calculated Fields in Model Driven Apps


Implementation Steps:

 

1. Navigate to https://make.powerapps.com

 

2. Click Solutions (if Already Available) else create a new Solution and add New Table or Existing Table

 

3. Create a new Field inside that Table (Start Date)

 

rampprakash_0-1649055496006.png

 

4. Create another field called End Date 

 

rampprakash_1-1649055496009.png

 

5. Save the Table

 

6. Create a Whole Number Field as Calculated

 

rampprakash_2-1649055496013.png

 

7. Click Calculation --> It will save the table and open a Separate Tab.

 

8. Once the Page Opens add following Condition

  •    Start Date Contains Data
  •    End Date Contains Data

9. Add DiffInHours (It is used to find difference between two dates)

 

10. Write below Query in the Action Field

 

DIFFINHOURS(cr2f9_startdate, cr2f9_enddate)

 

rampprakash_0-1649065757537.png

 

 

11. Now add 

  • Start Date
  • End Date
  • Difference in Date 

Fields into the Form.

 

12. Open a new Record and Input Date and Click Save

 

Positive Number : (End Date is Future)

 

rampprakash_1-1649065973474.png

 

 

 

Negative Number : (End Date is Past)

 

rampprakash_2-1649065994935.png

 

 

 

That's it :slightly_smiling_face:

No comments:

Post a Comment

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...