The record to be saved must not be null

Hello,

I have created a CDT, User Input form & Data Store, I have mapped and verified the data store its successful. The mappings were also successful, I have created a record also its successful. But when in the process model when I input data to the form and connect it to the data store, it fails and throws the following error.

 

There is a problem with task “Collection of Uniform Residential Loan Applicants” in the process “AT my first Appian Action”

Problem:  An error occurred in executing an Activity Class.

Details:  An error occurred while trying to write to the entity “Freddie_Mac_Form” [id=3ad89d38-4131-427b-a496-a3837351fb77@4514, type=CDT_InputFields (id=2626)] (data store: Freddie_Mac_Form). Details: java.lang.IllegalArgumentException: The record to be saved must not be null: TypedValue[it=2626,v=<null>] Data: TypedValue[it=2626,v=<null>]

Recommended Action:  Examine the activity class to correct the error and then resume.

Priority of this problem: High Priority

 

Can anyone please recommend how to resolve this and where to check for this.

  Discussion posts and replies are publicly visible

  • Hi nelloreal0001,

    It looks like you have a null CDT. Are you populating your CDT with any data before trying to save it? I get the same error when passing a null CDT to a Write to Data Store node.

    You need to initialize the CDT before saving it. Do this by mapping data into the CDT form a form or script task node.
  • Hi,

    The error seems to be caused due to not null fields in the table you are trying to write data for. As they don't accept null values pacing a null would result in an error. Try giving those fields some values or determine default values in DB as per the requirement.

    thanks,
    Abhishek gaddam .
  • Hello Jeromew,

    What is a null CDT ?? How do I check whether the CDT is null ??
    Are you populating your CDT with any data before trying to save it - I have no data in the CDT
    can you please explain me in detail please
  • Hello Abhishek,

    Thank You, I'm a beginner in Appian. Thus can you please let me know where in I have to "Try giving those fields some values or determine default values in DB as per the requirement."

    Might be the path to proceed or a screenshot would help.
  • 0
    Certified Lead Developer
    Please check the output of the form once you click on submit button.This error may cause because of the configuration of the "Submit" button you did on form.Test it in the interface and see whether the output is actually saving to CDT.
  • 0
    Certified Lead Developer
    Look in the process model properties of a running instance of the process model. Under variables, you'll find the CDT you're trying to save to the database. It should have values after you've submitted the form. You can click on the link on the bottom of the alert to go to the process and look for the CDT variable.

    If it doesn't have any values after you submit the form, there's probably a step missing in the rigging to and from the form. You have to save the CDT or it's component parts as activity parameters (ac! variables). You do that on the Inputs tab on the node. You also have to make sure the saveInto dropdown is set to save the values back to the right place in the process variables (pv! variables). Then you go to the Form tab and make sure the correct ac! variables match to the inputs of the form's SAIL code. It's best to use keyword arguments to make sure you don't miss any. Also be very careful to check the spelling, if one's misspelled it will just not use it and won't warn you.

    So process variable saves to AC variable, saves to rule input (ri! variable) in your SAIL, goes to a user input, your user can type what they want into the input, that gets saved to the RI variable, when you submit that gets saved to the AC variable, which gets saved back to the PV variable, and that goes to the database node. I know it's a bit much, but you get used to it. Once you've got it working and you can see the data you input in the process variables, it should be a cinch to work out any other problems if you're still having them.
  • You can check the CDT if it is null using the isnull() function.

    Additionally, I would suggest you check your database constraints if there are NOT NULLABLE fields.

  • 0
    Certified Lead Developer

    Hi nellorea0001 I would recommend investigating the process variable value by monitoring the process instance. If you not sure how to monitor a process then please follow this link.

    I believe, the process variable you are trying to persist into the DB is null, you need to make sure that you have populated your CDT values(via Interface / some manipulation) before storing it into the DB.

    Hope this will help.

  • Hi,

    Can we solve the error like give a xor gate and give a condition if it's null it will skip the write to DB step and pass on to the other remaining steps?