Skip to main content
January 30, 2024
Question

Handle Nulls in a Record type

  • January 30, 2024
  • 4 replies
  • 0 views

Hi Everyone,

How to handle null values in a recordtype?

My output is like this where first index is nul. To exlcude that in recordtype what needs to be done as i have used reject function as well but it will only work for an array.

Can someone please help me on this?

    4 replies

    stefanhelzle0001
    Brainy
    January 30, 2024

    I would try to identify the code that creates this null values and change that ...

    jayaprakashr0001
    Participating Frequently
    January 31, 2024

    Hi [mention:7657ae9700494c9ab3ce96484c26f54a:e9ed411860ed4f2ba0265705b8793d05] ,

    empty record also consider as single item and  not a null value. If possible can you share the code where these rows are getting created.

    harshitb6843
    January 31, 2024

    You can build your own custom null check rule for records like I have done. In the code below, ri!record is of ANY type. 

    and(
      a!forEach(
        items: a!keys(ri!record),
        expression: a!isNullOrEmpty(index(ri!record, fv!item, null))
      )
    )

    NOTE: This will only validate a single record and not a list. So you can add it in your reject function and it should work there. 

    gopuh0001Author
    February 5, 2024

    yes its working. Thank You!!