Search code examples
outsystems

Dealing with Null values oustystems


I have built in the functionality for a user to upload data from an excel file in my web app. However if the any of the cells contain null values then the upload does not work as it attempts to convert a " " string into an int or date.

I know the data fed into this tool will commonly contain null values. Any suggestions on how to deal with this issue would be greatly appreciated.

Thanks


Solution

  • In the interest of simplicity, OutSystems does not support NULLs for scalar/string types (only keys). Therefore you will either need to

    1. Have a specific value of the type reserved to be understood as null (e.g. 0 or -1 for Integer, "" or "NULL" for Text etc). Which value to use is highly dependent on your value space;
    2. Have an extra (Boolean) column in the excel that states if the associated column's value should be understood as NULL.

    In the later case, you will likely need to also propagate this boolean to your data model (if you need to keep track of these NULLs at a later date).