Skip to main content
richardm900458
March 3, 2021
Question

What is the best way to validate

  • March 3, 2021
  • 6 replies
  • 0 views

Hi together,
not sure if its a question or a discussion.
i just discovered that isnull() for a nested CDT is not working properly

I have a CDT Processdata {"id"(integer), "startedAt"(datetime), "attachment"(CDT attachment),...}

which contains the nested CDT "attachment"   {"id"(integer), "document"(document)....}

-> If I try to do isnull(ri!processData.attachment.document) it is not working and i always get false as result, even the value is NULL (100%)
-> if I try      ri!processData.attachment.document= todocument(Null)   its fine.

->  isnull(ri!process.documenttest) is working, so it seems to be just an issue regarding nested document CDT as far is can clarify.

a) is that a bug by appian?

b) what would be your approach to solve it? What is your best practice here?

Thank you all :)

6 replies

stefanhelzle0001
March 3, 2021

Did some small tests. But only with static data. Not from DB, just as rule inputs. Works for me. Can you provide more details? Is that nested type an array?

richardm900458
March 10, 2021

Fast Reproduction:


a!localVariables(
local!processData:'type!{urn:com:appian:types:fwe}FWE_processData'(attachements: 'type!{urn:com:appian:types:fwe}FWE_Attachements'(document: ri!document)),

isnull(local!processData.attachements.document)

)

The isnull function gives back "false" (for ri!document= NULL)

santhoshr
March 3, 2021

create a rule with the following code:

or(isnull(ri!input), ri!input="", length(ri!input)=0)

where ri!input is (Any Type) and see if this works in your scenario

manuelh0002
March 3, 2021

that's the way I have approached this kind of issue. It works for me

richardm900458
March 10, 2021

Hi santhos, Hi Manuel,
Thank you both for your input,
I have a similar solution :)