Hi,
I'm having some issues with a Canvas App I've created linked to Dataverse.
Table: Table1
Columns: Place (Lookup at table Places), Vehicle (Lookup at table Vehicles), Date, Complete (Yes/No), Remark (Text)
The app consists of 2 comboboxes (place, vehicle), a date field, a checkbox and a textfield and a big button to submit.
The comboboxes only allow 1 selection.
In the OnSelect of the submitbutton, I have the following:
Patch(Table1, Defaults(Table1), {
Place: cmbPlace.Selected,
Vehicle: cmbVehicle.Selected,
Date: dtpDate.SelectedDate,
Complete: chkComplete.Value,
Remark: txtRemark.Text})
Everything works like a charm when everything is filled in. But if Place and/or Vehicle is empty it won't create a new record in Table1.
I've tried several things, such as: If((IsBlankOrError(cmbVehicle.Selected) || IsEmpty(cmbVehicle.Selected)), Set(varVehicle, {}), Set(varVehicle, cmbVehicle.Selected) or If((IsBlankOrError(cmbVehicle.Selected) || IsEmpty(cmbVehicle.Selected)), Set(varVehicle, Blank()), Set(varVehicle, cmbVehicle.Selected).
Can someone help me, please? 😋
Solved! Go to Solution.
This issue was solved by switching on an experimental feature called 'Formula level error management'.
By switching that on, Power Apps suddenly allows Blank() to be patched to the lookup columns in Dataverse.
You need both id and value to patch a lookup field.
Patch('SP List',Defaults('SP List'),{Id: -1, Value:Blank()})
This is how you patch a blank value in lookup field. tweak it according in your code.
Hi!
Thanks for your quick reply!
I still get the error: "value must be a data entity record" 😐
Oh then it must be different for dataverse. It does work in sharePoint. Sorry i can't be any more help. Since i have no exp with Dataverse
This issue was solved by switching on an experimental feature called 'Formula level error management'.
By switching that on, Power Apps suddenly allows Blank() to be patched to the lookup columns in Dataverse.
User | Count |
---|---|
253 | |
106 | |
94 | |
50 | |
39 |