Closed techakki81 closed 2 years ago
@techakki81 templating doesn't support .length
on the collection but we have a function count(collection)
to do the same thing.
For example in your scenario you would use:
"$when": "${count(lstHol)>0}"
to achieve your desired behavior :)
Here's the link to the docs describing this specific functionality.
Target Platforms
NodeJS
SDK Version
1.3
Application Name
Viva Connection
Problem Description
"When" clause is not working when the input array is used as a condition
My use case is to show this section only if the array lstHol has some entries . I tried with following schema but in all of these the template completely ignore the element. { "type": "FactSet", "$when": "${lstHol.length>0}", --> also tried with "${$lstHol.length>0}" / "${$lstHol}" "facts": [
{ "$data":"${lstHol}",
"title": "${localName}", "value": "${date}" }
Screenshots
No response
Card JSON
Sample Code Language
No response
Sample Code
No response