Hi Appian community I am trying to add a value on to an editable grid
like this:
however my problem is when I try and access the 0's I get this error
I have tried to instantiate all the values as 0 but the array does not seem to register
here is my code thus far for my integer field
a!integerField( value: and(if(isnull(ri!rank),0,ri!rank[fv!index]), if(length((ri!rank)>fv!index),0,ri!rank[fv!index]) ), saveInto: ri!rank[fv!index], required: true )
any assistance would be greatly appreciated,
Discussion posts and replies are publicly visible
What is the intended purpose of the and() statement within the value parameter of this integer field? It seems like you might be using it wrong.
I am attempting to do a null check and an "out of bounds" check where the index goes out of bounds which is what I got out of the error message
The problem is, you're setting the value directly to the result of the evaluation of the and() expression, which is a boolean (true/false) value only, and I expect that's not what you actually want. You probably just want to make use of the index() function (no relation to fv!index which you're already using), which inherently ensures the position you're accessing actually exists within the array.
value: index(ri!rank, fv!index, 0),
Thanks Mike that is exactly what I needed , and I will try to work on my code format