Hello Folks,
Please anyone guide me on this?
I am using below code and getting this error: "Cannot mul incompatible operands of type List of Variant and type List of Variant." Basically I am multiplying two values. Any thoughts on this?
a!textField( label: "", labelPosition: "ADJACENT", value:product(index(ri!case, "amount", {}), index( ri!case, "newamount", {} ) / 100), readOnly: true(), ),
Discussion posts and replies are publicly visible
Yes. Index returns values wrapped into a variant. I suggest to either use dot-notation or cast the values into numbers.
hi manjit.1486 as Stefan Helzle mentioned could try with dot notation as mentioned below
product( ri!case.amount, ri!case.newamount/ 100),
Can you try the following code, i.e., replacing the index function's default value with zero ex. index(ri!case, "amount", {}) -> index(ri!case, "amount", 0) and index(local!case, "newamount", {}) -> index(local!case, "newamount", 0)
a!localVariables( local!case: a!map(amount: 50, newamount: 100), a!textField( label: "", labelPosition: "ADJACENT", value: product( index(local!case, "amount", 0), index(local!case, "newamount", 0) / 100 ), readOnly: true() ) )
Sure, I will try.
let me check this.