DateValue

How to Use the Power Fx DateValue  Function in Power Apps

In this article, we will take a look at how to use the Power Fx DateValue function in Power Apps.

What is the Power Fx DateValue Function?

The Power Fx DateValue function is a function that allows you to convert a string into a date value. This function is especially useful when you are working with date/time values in Power Apps.

How to Use the Power Fx DateValue Function

To use the Power Fx DateValue function in Power Apps, you need to follow a few simple steps:

1. Open your Power App and navigate to the screen where you want to use the DateValue function.

2. Add a Text input control to your screen. This will be the control that you will use to enter the string that you want to convert to a date value.

3. Add a label control to your screen. This will be the control that will display the date value after it has been converted.

4. In the OnSelect property of a button, add the following formula:


This formula will convert the string entered in the TextInput1 control into a date value.

5. Set the Text property of the label control to the formula you just created:


This formula will display the date value in the label control.

Examples of Using the Power Fx DateValue Function

Here are a few examples of how to use the Power Fx DateValue function in Power Apps:

Example 1

Suppose you have a Text input control called “DateInput” that allows users to enter a date in the format “MM/DD/YYYY”. To convert this string into a date value, you can use the following formula:


This formula will convert the string entered in the DateInput control into a date value.

Example 2

Suppose you have a Text input control called "TimeInput" that allows users to enter a time in the format "HH:MM:SS". To convert this string into a time value, you can use the following formula:


This formula will convert the string entered in the TimeInput control into a time value.

The Power Fx DateValue function is a powerful tool that allows you to convert a string into a date value in Power Apps. By following the steps outlined in this article, you can easily start using this function in your own apps. So go ahead and start experimenting with the DateValue function today!

Power Apps Training Courses by G Com Solutions (0800 998 9248)