A common scenario when using a canvas application is editing previously saved records and saving them back to the data source. If your data source is a SharePoint list, and the updated value is null, this can cause some unexpected results. When you choose the field data type of Date, Choice or Person, SharePoint does not update its fields to null. Therefore, the SharePoint fields still displays the old values.

A quick fix to the problem is if you turn on the Formula-level error management option under Experimental features in your Canvas application.

To do that, edit your Canvas application and go to File-> Settings-> Advanced Settings. Then scroll down to Experimental Features and turn on the option for Formula-level error management.

Since this fix uses an experimental feature, it may not always resolve the issue using the above method.

Your next solution is to check for blank values on the Canvas application. From there, you can manually patch SharePoint fields with a blank variable.

As an example, a blank variable can be defined in OnVisible of the form. Then, you can use the blank variable to update a choice field like below:

Set(
    BlankChoice,
        {
            Id: -1,
            Value: Blank()
        }
);

Before saving the data back to SharePoint, check the value for the Combo box. You may need to execute a patch statement as shown below:

If (IsBlank(cboTestField.Selected.Title),    
 Patch(TestList,SelectedItem,
    {
        TestField:BlankChoice
     }
 )
);

Similar checks and patch statements can be performed for Person (For Person datatype a table needs to be created with blank () fields) and Date fields.

Interested in more Tech Support articles? Check out these:

For more information on PPM solutions, and how you can better utilise applications in the Microsoft Ecosystem, have a browse of our blog, or reach out to our PPM experts!

Laith Adel
Laith Adel