I have CDT array, CDT has a property :Name. I receive CDT array from web-service

I have CDT array, CDT has a property :Name. I receive CDT array from web-service. I need to check if CDT.Name is null then set it to some default value. I tried this is expression rule and process models too. Bt I am not able to set the value in CDT array. Also CDT array received can be of any length, 0 or 50. So need to find logic that will loop through CDT and check property Name if null and set it to default value. Thanks

OriginalPostID-165432

OriginalPostID-165432

  Discussion posts and replies are publicly visible

Parents
  • The apply function can solve your purpose. You can write an expression that takes a single value, default text and loop this function over your cdt property name array.
    Eg: apply(rule!setDefaultIfNull, pv!cdtArray.name, "defaultValue") -- store the result of this into -> cdtArray.name
    rule!setDefaultIfNull -- if(rule!APN_isEmpty(ri!name), ri!defaultValue, ri!name)
Reply
  • The apply function can solve your purpose. You can write an expression that takes a single value, default text and loop this function over your cdt property name array.
    Eg: apply(rule!setDefaultIfNull, pv!cdtArray.name, "defaultValue") -- store the result of this into -> cdtArray.name
    rule!setDefaultIfNull -- if(rule!APN_isEmpty(ri!name), ri!defaultValue, ri!name)
Children
No Data