Do you know how to patch Dataverse Number field in Power Apps? No worries. In this Dataverse tutorial, we will discuss what are the possible and easiest ways to update a Dataverse Number Column in Power Apps.
Also, we will cover the topics below:
- How to Patch Dataverse Number Field using Power Apps Dropdown Control
- Update Dataverse Number Field using Power Apps Combobox Control
- Patch Dataverse Number Field using Power Apps Text input Control
- Update Dataverse Number Field using Power Apps Slider Control
- How to update Dataverse Number Field using Power Apps Edit Form Control
I recently had a project where I wanted to use Power Apps to patch the Dataverse Number field. Also, I had to use a Dropdown control to update the Dataverse Number column. I then had some thoughts and ideas that I want to share in this post. Let’s investigate this now.
Patch Dataverse Number Field in Power Apps
First of all, What does mean by Patch Dataverse Number Field in Power Apps? Let’s understand this from the below scenario.
Scenario:
The below screenshot represents a Dataverse Table named Car Details. This table has various columns (with different data types) like:
- Car Name = Primary Column name with a Single line of text data type
- Car Owner = Single line of text data type
- Owner Contact Number = This is a Number Column
- Booking Date = Date column
- Color = Choice Column
- Country = Choice Column
- Price = Currency Column
Also, you can see the Dataverse table has all the below records. Now I would like to patch the Owner Contact Number of the third record i.e. Smith.
- In Power Apps, insert a Button Control and rename it to Update Owner Contact Number.
- Select the button control and apply the code below on its OnSelect property as:
OnSelect = Patch(
'Car Details',
LookUp(
'Car Details',
'Car Owner' = "Smith"
),
{'Owner Contact Number': 1117826710}
)
Where,
- Patch = Power Apps Patch Function is used to create a new record or modify single or multiple records in a data source.
- ‘Car Details’ = Provide Dataverse Table Name
- LookUp = Power Apps LookUp function locates the first record in a table that fulfills a formula.
- ‘Car Owner’ = Provide the Dataverse column name of whom you want to update the value
- “Smith” = Specify the owner name of whom you want to update the value
- ‘Owner Contact Number’ = Dataverse Number Field
- 1117826710 = Specify the integer value that you want to update in the Dataverse number column
NOTE:
But before applying the above code, make sure you need to connect the Dataverse Connector and choose the Dataverse table (Car Details) to Power Apps. If not, you can experience certain issues.
- Now Save and Publish the app. Preview the app and tap on the button (Update Owner Contact Number). Then come back to the specific Dataverse table (Car Details) and refresh it once. You can see the specific Dataverse number field value has been updated to the new one as shown below.
This is how to Patch Dataverse Number Field in Power Apps.
Patch Dataverse Number Field using Power Apps Dropdown Control
Next comes how we can update or patch Dataverse Number Field using Power Apps Dropdown Control.
- In the below Dataverse table (Car Details), you can see there is a Number column named Current Mileage. Now I would like to update the Current Mileage of the second record i.e. Reyon (Car Owner).
- To patch the Dataverse Number value, we can also use the Power Apps Dropdown control.
- In Power Apps, insert a Dropdown control and get all the dataverse number values using the code below (Items property):
Items = Distinct(
'Car Details',
'Current Mileage'
)
Where,
- Distinct = A formula can be evaluated across all table records with the help of Power Apps distinct function, which then delivers a one-column table with the results with duplicate values deleted.
- Car Details = Dataverse Table Name
- Current Mileage = Dataverse Number Column Name
- Now, add a button control (Click Here!) and set its OnSelect property to the code below:
OnSelect = Patch(
'Car Details',
LookUp(
'Car Details',
'Car Owner' = "Reyon"
),
{'Current Mileage': ddSelectMileage.Selected.Value}
)
Where,
- ‘Car Details’ = Dataverse Table name
- ‘Car Owner’ = Provide the Dataverse column name of whom you want to update the value
- “Reyon” = Specify the owner name of whom you want to update the value
- ‘Current Mileage’ = Dataverse Number Field Name
- ddSelectMileage = Dropdown Control Name
- Now Save and Publish the app. Preview the app, Select any value from the dropdown control, and tap on the button (Click Here!).
- Then come back to the specific Dataverse table (Car Details) and refresh it once. You can see the specific Dataverse number field value has been updated to the new one as shown below.
In this way, we can update Dataverse Number Field using Power Apps Dropdown Control.
Also, Read: PowerApps Cascading Dropdown (Detailed tutorial)
Patch Dataverse Number Field using Power Apps Combobox Control
Now we will check how to patch the Dataverse Number Field using Power Apps Combobox Control.
- In this scenario also, I have taken the same above Dataverse table (Car Details) and the same Number field as Current Mileage.
- Next, I would like to update or patch the Dataverse number field value of the fifth record Steward using a Power Apps Combobox control (with Allow Single Value).
- In Power Apps, insert a Combobox control (Allow Single Value) and get all the dataverse number values using the code below (Items property):
Items = Distinct(
'Car Details',
'Current Mileage'
)
- Now, apply the code below on the button’s OnSelect property:
OnSelect = Patch(
'Car Details',
LookUp(
'Car Details',
'Car Owner' = "Steward"
),
{'Current Mileage': cbSelMileage.Selected.Value}
)
Where,
- ‘Car Details’ = Provide Dataverse Table name
- ‘Car Owner’ = Provide the Dataverse column name of whom you want to update the value
- “Steward” = Specify the name of whom you want to update the value
- ‘Current Mileage’ = Dataverse Number Field name
- cbSelMileage = Power Apps Combo box control name (Allow Single Value only)
- Now Save and Publish the app. Preview the app, Select any value from the combo box control, and tap on the button (Tap & Update).
- Go to the specific Dataverse table (Car Details) and refresh it once. You can see the specific Dataverse number field value has been updated to the new one as shown below.
This is how to Patch Dataverse Number Field using Power Apps Combobox Control.
Check out: Power Apps Rating Control – How to use
Patch Dataverse Number Field using Power Apps Text input Control
Do you know how to Patch Dataverse Number Field using Power Apps Text input Control? Well, refer to the Power Apps code below to achieve this.
- I used the same Dataverse table (Car Details) as earlier and the same Number column (Current Mileage) for this situation as well.
- Using a Power Apps Text input control, I would then like to modify or patch the Dataverse number field value of the fourth record Alexander.
- In Power Apps, insert a Text input control and rename it to txtEnterMileage.
- Add a Button control (Click & Update) and set its OnSelect property to the code below:
OnSelect = Patch(
'Car Details',
LookUp(
'Car Details',
'Car Name' = "Duster"
),
{'Current Mileage': Value(txtEnterMileage.Text)}
)
Where,
- ‘Car Details’ = Provide Dataverse Table name
- ‘Car Name’ = This is my Dataverse Primary Column Name
- “Duster” = Specify the car name that you want to update the number
- ‘Current Mileage’ = Dataverse Number Field name
- txtEnterMileage = Power Apps Text input control name
Refer to the image below.
- Now Save and Publish the app. Preview the app, Enter the value in the text input control that you want to update in the Dataverse number field, and tap on the button (Click & Update).
- Navigate to the Car Details Dataverse table and do a single refresh. You can see that the value of the specified Dataverse number field has been changed to the one displayed below.
This is how to update Dataverse Number Field using Power Apps Text input Control.
Patch Dataverse Number Field using Power Apps Slider Control
Next, we will see how to update Dataverse Number Field using a Power Apps Slider Control.
- For this scenario, I also used the same Dataverse Number column (Current Mileage) and Dataverse table (Car Details) as earlier.
- I would then like to change or patch the Dataverse number field value of the first record Audi using a Power Apps Slider Control.
- In Power Apps, add a Slider control and rename it to sdMileage.
- Insert a Button control (Click & Update) and set its OnSelect property to the code below:
OnSelect = Patch(
'Car Details',
LookUp(
'Car Details',
'Car Name' = "Audi"
),
{'Current Mileage': sdMileage.Value}
)
Where,
- ‘Car Details’ = Provide the Dataverse Table name
- ‘Car Name’ = This is my Dataverse Primary Column Name
- “Audi” = Specify the car name that you want to update the number
- ‘Current Mileage’ = Dataverse Number Field name
- sdMileage = Power Apps Slider control name
- Now Save the app, then publish it. To update a specific value in the Dataverse number field, open the app in preview mode, move the slider to that value, and then hit the button (Click & Update).
- Do a single refresh in the Car Details Dataverse table by navigating there. The value of the selected Dataverse number field has been changed to the one shown below, as you can see.
This is how to patch Dataverse Number Field using Power Apps Slider Control.
Have a look: How to Detect Text in Dataverse Using AI Builder
Patch Dataverse Number Field using Power Apps Edit Form Control
Finally, We will see how to Patch Dataverse Number Field using Power Apps Edit Form Control.
The below screenshot represents a Dataverse table named Patient Registrations. In this table, there are various columns with various data types. Such as:
- Patient Name = This is a Primary column having with Single line of text data type.
- DOB = Date Data type
- Age = Whole Number Data type
- Address = Multi-line of text Data type
- Reason = Dataverse Choice Column
- Patient Phone Number = Dataverse Phone Number Column
- In Power Apps, there is an Edit form control with all the Dataverse fields including the Number field (Age). Now I would like to create a new record in the Dataverse table when a user will click on the REGISTER button.
- To do so, select the button control (REGISTER) and apply the code below on its OnSelect property as:
OnSelect = Patch(
'Patient Registrations',
Defaults('Patient Registrations'),
{
'Patient Name': DataCardValue1.Text,
'Patient Phone Number': DataCardValue6.Text,
DOB: DateValue1.SelectedDate,
Age: Value(DataCardValue3.Text),
Address: DataCardValue4.Text,
Reason: DataCardValue5.SelectedItems
}
)
Where,
- Patch = Power Apps Patch Function is used to create a new record or modify single or multiple records in a data source.
- ‘Patient Registrations’ = Provide Dataverse Table name
- Age = Dataverse Number Field Name
- DataCardValue3 = Data card value of Age
Refer to the screenshot below.
- Finally, save and publish the app. Preview the app and enter all the details in the form including the age. Then, click on the REGISTER button.
- Go to the specific dataverse table and refresh it. You will see a new record has been created including the number field i.e. Age.
This is how to update Dataverse Number Field using Power Apps Edit Form Control.
Furthermore, you may like some more Dataverse tutorials:
- How to Patch Dataverse Choice Column in Power Apps
- Power Apps Select All Checkbox in Gallery
- Power Automate Get Display Name From Email
- Power Automate Dataverse Add New Row
- How to Display Dataverse Choices in Power Apps Gallery
- Dataverse Power BI [Complete tutorial]
- How to Get Power Apps Environment ID
- How To Get Dataverse List Rows Count Using Power Automate
In this Dataverse tutorial, we discussed what are the possible and easiest ways to update a Dataverse Number Column in Power Apps.
Also, we covered the topics below:
- How to Patch Dataverse Number Field using Power Apps Dropdown Control
- Update Dataverse Number Field using Power Apps Combobox Control
- Patch Dataverse Number Field using Power Apps Text input Control
- Update Dataverse Number Field using Power Apps Slider Control
- How to update Dataverse Number Field using Power Apps Edit Form Control
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com