Import Mapping - handling null values

I’m trying to import data from an external application using a Call REST activity in a microflow. There are instances in the external application, where not all the fields have been filled out and this may be considered quite normal.   As such, there will be times that some of the values that are being imported will be null. I would like to know how these null instances should be handled.   The error that I’m receiving is:   com.mendix.modules.microflowengine.MicroflowException: Error calling REST service     at Integration.ACT_ImportData (CallRest : 'Call REST (GET)') Advanced stacktrace:     at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:79) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: Error while importing, key value for 'Identifier' should not be null.  
2 answers

They should be handled by confirming your application to the data-definition of the external application's message-content. Currently they have an attribute that is not always present. This means that the attribute is 'optional’ in the data-definition of the external application. In your application, you have set the same attribute to be a key-value. Keys are obligatory, and in doing so you have defined the attribute to obligatory. Hence the error.

To solve it, you should make the attribute ‘optional’ in your importmapping. You can do this by unmarking the attribute as 'key'. In your domain model, you can set the default value for that attribute. In the microflow, after the import-mapping you can do whatever you need to do for setting the value of the key-attribute.


Good day Ryan


The problem you are having is due to you key values having null values. This is something that you can not allow. Thus you will need to change you key value to something that will not be null or you will have to change your REST call so that you do not need key values.  

‘Error while importing, key value for 'Identifier' should not be null.’