Customer Portal

Lookup Functions Error: Unexpected null value

Comments 4

  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi,

    could you please attach the whole project (including data sample).

    Thanks!
  • Avatar
    yichuansancun
    0
    Comment actions Permalink
    Here you go! Thanks!
  • Avatar
    yichuansancun
    0
    Comment actions Permalink
    I solved the problems, I changed the code to the following and worked:

    if(lookup(Citizenship).get($in.0.c_country, $in.0.c_citizenship_status) == null)
    { $out.0.WD_Ref = "not found";}
    else
    {
    $out.0.WD_Ref = lookup(Citizenship).get($in.0.c_country, $in.0.c_citizenship_status).WD_Ref_ID;}
  • Avatar
    dpavlis
    0
    Comment actions Permalink
    You can also use CTL's conditional fail expression.

    The code would look like this:

    $out.0.WD_Ref = lookup(Citizenship).get($in.0.c_country, $in.0.c_citizenship_status).WD_Ref_ID : "not found";

Please sign in to leave a comment.