NewForm

NewForm

How to Use the Power Fx NewForm  Function in Power Apps

One of the functions in Power Fx is the NewForm function, which is an efficient way to create a new form in Power Apps. The NewForm function is particularly useful when you want to create a new record in your data source.

In this guide, we will explore how to use the Power Fx NewForm Function in Power Apps.

Understanding the Power Fx NewForm Function

The NewForm function in Power Fx creates a new form, which is typically used to create a new record in your data source. It is a simple function that takes one parameter, which is the data source you want to use. You can use the NewForm function with any data source in Power Apps.

Creating a NewForm in Power Apps

To create a new form in Power Apps, you need to follow these simple steps:

1. Open Power Apps Studio, and create a new app or open an existing one.

2. Add a new screen to your app by selecting the “Blank screen” option from the Screen templates.

3. Add a data source to your app by selecting the “Data sources” option from the left pane. Choose the data source you want to use.

4. Add a form to your screen by selecting the “Form” option from the “Insert” tab. Choose the data source you want to use.

5. Set the form’s Item property to the NewForm function. To do this, select the form and go to the “Properties” tab. Under the “Data” section, set the “Item” property to the NewForm function.

Once you’ve followed these steps, you should be able to create a new record in your data source by using the form. The form will automatically be populated with the fields that you’ve selected in your data source.

Customizing the NewForm Function

The NewForm function is highly customizable, and you can use it in various ways to suit your needs. For instance, you can use the NewForm function to create a new record in your data source with prepopulated data. This can be done by setting the form’s Item property to a formula that generates the prepopulated data.

You can also use the NewForm function to create a new record in your data source and redirect the user to a different screen after submitting the form. This can be done by setting the form’s “OnSuccess” property to a formula that navigates to a different screen.

Adding Validation to the NewForm Function

Validation is an essential aspect of data entry, and you can add validation to your Power Apps forms using the NewForm function. You can add validation to your form by creating a formula that checks the validity of the data entered in the form. If the data is invalid, the formula will display an error message.

To add validation to your Power Apps form, you need to follow these steps:

1. Create a formula that checks the validity of the data entered in the form. For instance, you can check if the email address entered by the user is valid.

2. Add the formula to the form’s “OnSuccess” property. This will ensure that the formula is executed when the user submits the form.

3. If the formula returns an error, you can display an error message to the user using the Notify function.

The Power Fx NewForm function is an essential tool for creating new records in your data source in Power Apps. With the function, you can create a customized form that suits your needs and add validation to the form to ensure that the data entered is valid. By following the steps outlined in this guide, you should be able to create a new form in Power Apps using the NewForm function.

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