a!documentImage( document: if(isnull(fv!item.imageId), cons!NOIMAGE, fv!item.imageId )
is it possible to use fv!item with the isnull funcion? i am trying to place a image (cons!NOIMAGE) if theres no image in the database for that specific object but i get an error saying that document cant be null so I supose its returning a True boolean in the if statement
Discussion posts and replies are publicly visible
I think its return a false boolean*
isnull wil typically not catch all variations of "there is no value". My approach, matured over many years, is this:
ri!value is of type "any"
if( isnull(ri!value), true, a!localVariables( local!typeNum: a!refreshVariable( value: runtimetypeof(ri!value), refreshAlways: true ), /* Strings */ if( local!typeNum = 'type!{http://www.appian.com/ae/types/2009}Text', /* Ignore white space */ len(trim(ri!value)) = 0, /* List of Variant */ if( local!typeNum = 'type!{http://www.appian.com/ae/types/2009}Variant?list', all(fn!isnull, a!flatten(ri!value)), /* Lists */ if( /* Try to take first item in list and cast it to a list of itself */ /* then compare its datatype to the incoming data type */ local!typeNum = runtimetypeof(cast(runtimetypeof({index(ri!value, 1, null)}), ri!value)), /* Flatten takes care of lists in lists in lists in ... */ /* List has zero non-null items, length() already ignores null values*/ length(a!flatten(ri!value)) = 0, /* DataSubsets */ if( local!typeNum = 'type!{http://www.appian.com/ae/types/2009}DataSubset', if( ri!value.totalCount < 0, /* This is necessary in case fetchTotalCount=false */ if( isnull(ri!value.data), true, length(ri!value.data) = 0 ), ri!value.totalCount = 0 ), /* No idea what this could be so it is considered to not be null */ false )))) ) )
Sorry I'm still new to Appian, couldnt understand what I'm suppose to do, can you simplify?
the imageId is listed as a document and its an array in the cdt don't know if that helps
I thought about addint a collumn to the cdt as a boolean validating if there are pictures uploaded, but then it says i need to update my data store manualy, I dont know if i'll screw it up by changing something
Appian will not change the data types of fields in database. Simply drop the table and have Appian recreate it.
That boolean will not solve your problem. You need to check whether there is a valid value. Put my code into a separate expression and use it for null checks.
My idea was that if the haspicture boolean is false then it would substitute the isnull funcion, if haspicture was true it would show the pictures saved, nonetheless i change the form to have a required picture and so theres no null values in imageId, but thank you