Hi ,
I am facing some issue after adding one condition to below working code. After adding its returning document as null.
Kindly help me and correct me where i am missing in the below code snippet.
Kindly find below working and non working code and error message .
-------------------------------Working code---------------------------- a!gridImageColumn( label: "", size: "ICON", data: if(rule!APN_isEmpty(local!testsubset.data),{},apply( a!documentImage(document: _,caption: _), merge( apply(a!iconIndicator, {if(todate(local!testsubset.data.strDate)>today(),"Hello", "Hii")}), apply(touniformstring(_),{ merge( if(todate(local!testsubset.data.strDate)>today(),"Hi to all","Hello to all"), todate(local!testsubset.data.strDate))}) ) )) ) -------------------------------- Added code which is giving below error--------------- a!gridImageColumn( label: "", size: "ICON", data: if(rule!APN_isEmpty(local!testsubset.data),{},apply( a!documentImage(document: _,caption: _), merge( apply(a!iconIndicator, {if(todate(local!testsubset.data.strDate)>today(),"Hello", "Hii")}), apply(touniformstring(_),{ merge({ if(count(local!testsubsetFinal)>0, if(local!testsubset.data.id=local!testsubsetFinal.id,"Hi to all","Hello to all"),"Date Implemented"), todate(local!testsubset.data.strDate)})}) ) )) ) Error Evaluating UI ExpressionExpression evaluation error in rule 'Test_Rule' (called by rule 'Master_Rule') at function a!gridField [line 126]: The image at index 13 in an grid component [label=“”] has an invalid value for “document”. “document” must not be null.
Discussion posts and replies are publicly visible
If you have access to use the a!forEach function try that instead. I find forEach much easier to use for looping. Something along the lines of a!forEach(items: local!testsubset.data, expression : a!documentImage( /* code to determine the document to display*/ )). You shouldn't need to use the merge commands so it should simplify your code - I'd also suggest using proper documents to start with as I'm not sure the values you're passing in are actual document icons ?
These are icons only. But by just changing if condition its not working. I tried to simply put "true" also in if condition not working.
Saying it should be list in merge function. I had put {} then its started saying document object is null.
I am not understanding why that is tightly bounded with this condition. I can't change this code pattern as of now.
Can you post the full code snippet as I've just tried to create a dummy interface in my sandpit and I'm getting an error message around
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!iconIndicator [line 16]: Invalid value for “icon”. Received: Hii. Supported values are: