web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Creating a record with...
Power Apps
Answered

Creating a record with empty fields...

(0) ShareShare
ReportReport
Posted on by 17

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? 😋

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    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.

  • KCoeck Profile Picture
    17 on at

    Hi!

     

    Thanks for your quick reply! 

    I still get the error: "value must be a data entity record" 😐

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    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

  • Verified answer
    KCoeck Profile Picture
    17 on at

    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. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard