Skip to main content

FAQ: How do I define alternate logic for records that contain an empty field?

Comments

2 comments

  • Permanently deleted user
    Celigo University Level 2: Seasoned
    Engaged

    I tried it with the following data:

    {
      "record": {
        "id": 5347,
        "company": "",
        "first_name": "Sample",
        "last_name": "Person",
        "email": "sample.person@gmail.com",
        "phone": "3056661212",
        "form_fields": null,
        "date_created": "Fri, 21 Jan 2022 01:26:16 +0000"
        }
    }

    I wanted to put in a replacement value for when the form_fields, like you see in this record, are null.  When it is populated, it is a subarray with three known values. I tried the code above, and I could NOT get it to work.  I'd really LIKE to get something in place of that data if that field is null.  Is there another way?

    0
  • Tom Santiago Principal Technical Writer Community moderator
    Engaged
    Top Contributor
    Celigo University Level 4: Legendary

    Hi @...,

    I've revised the post to be a more general example and included instructions for how to modify the script to work for most use cases. The original post was written for specific record structures. Please try again using the revised instructions, and let me know if you still run into problems.

    Tom

    1

Please sign in to leave a comment.