Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Team,
I have 3 tables
DepartmentTable | ||
Dept_ID | DeptName | |
1 | HR | |
2 | Finance | |
3 | IT | |
4 | KYC | |
5 | Sales | |
Dept_ID (Identity) | ||
Dept_ID Primary Key |
2)
College Branch | ||
College ID | CollegeName | City |
100 | SBC | Pune |
101 | ABC | Delhi |
102 | HIND | Kolcatta |
103 | CUBE | Chennai |
104 | Forum | Banglore |
College ID (Identity) | ||
College ID Primary Key |
3)
RevenueTable | |||||
RevID | Dept_ID | College ID | Revenue | Date | UpdatationDatetime |
1 | 1 | 100 | 100 | 11/1/2021 | 11/1/2021 |
2 | 2 | 101 | 105 | 11/2/2021 | 11/2/2021 |
3 | 3 | 102 | 110 | 11/3/2021 | 11/3/2021 |
4 | 4 | 103 | 120 | 11/4/2021 | 11/4/2021 |
5 | 5 | 104 | 130 | 11/5/2021 | 11/5/2021 |
6 | 1 | 100 | 140 | 11/6/2021 | 11/6/2021 |
7 | 2 | 101 | 150 | 11/7/2021 | 11/7/2021 |
8 | 3 | 102 | 160 | 11/8/2021 | 11/8/2021 |
9 | 4 | 103 | 170 | 11/9/2021 | 11/9/2021 |
10 | 5 | 104 | 180 | 11/10/2021 | 11/10/2021 |
RevID (Identity) | |||||
College_ID Foreign Key | |||||
College_ID Foreign Key |
Requirment- I want to create a form to insert/update/delete records to the Revenue table by using power apps.
in the power apps with to create a dropdown selection with Deptname, college name and City
eg. once user select the "HR" and SBC and Pune from the dropdown then user should add the revenue value(500) and date(2021-11-11) in the textbox
then automatically it will insert the record in the Revenue table As
RevID | Dept_ID | College ID | Revenue | Date | UpdatationDatetime |
11 | 1 | 100 | 500 | 11/11/2021 | 11/26/2021 14:23:343 |
Thanks,
Hey @Anshenterprices
for that, you can use the patch function to insert the record into the database.
updateif and patch function is used to update the record from the database and you want to delete the record from the database for that you can use the remove function.
Update function updates the entire record in a database.
UpdateIf and Patch functions update only specific columns. Update and UpdateIf both return table as a modified data source.
for inserting the record into the database:-
Patch(datasourcename, Defaults(datasourcename), {DepartmentName:drpDrptname.selected.value, CollegeName:drpclgname.selected.value, City:drpCityName.selected.value, Revenue:Value(500), Date:Today()});
and if you want to remove the record from the gallery then use the delete icon and then onselect property
OnSelect :- Remove(datasourcename, ThisItem)
I hope this is helpful for you.
Thank You!
What is your question ?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.