Skip to main content
richardm900458
Inspiring
Mar 3, 2021 7:44 AM UTC
Question

What is the best way to validate

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
Brainy
Mar 3, 2021 8:28 AM UTC

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
Inspiring
Mar 10, 2021 2:19 PM UTC

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
New Participant
Mar 3, 2021 4:39 PM UTC

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
Participating Frequently
Mar 3, 2021 6:25 PM UTC

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

richardm900458
Inspiring
Mar 10, 2021 2:25 PM UTC

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