Hi, We recently implemented a rank that grants the user 2 points per kudos. I have a component that is supposed to do a count of the amount of users and this worked fine until we granted the thanks...
Hi TariqHussain, thanks for the advice. I have got it to half work but I need to convert the API v2 call to a number in order to apply some logic to it.
Is there a way to convert it to a number so I can get the count?
Basically, what I am trying to do is count the amount of kudos for a message, list the users who gave the kudos and cut it off at a specific number to add a 'and X amount of others'. Here is my code with your implementation:
For "?number" left-hand operand: Expected a string or something automatically convertible to string (number, date or boolean), but this has evaluated to a sequence (wrapper: f.t.SimpleSequence):
==> kudosCount [in template "module-WhoThankedThisPost" at line 20, column 6]
----
FTL stack trace ("~" means nesting-related):
- Failed at: #if kudosCount?number gte 1 [in template "module-WhoThankedThisPost" at line 20, column 1]
How do I get it so the kudosCount to be converted to a number? I am using the ?number but its saying its a string.
Thanks TariqHussain, its starting to get somewhere now. The problem now is that the kudosCount?size?number is always equating to 0 so the api call isn't working as expected. It works in the API browser in Studio if I wrap the messageId with quotes but it doesn't work in the query when I output the kudosCount as it always comes back with 0.
Edit: Sorry to keep badgering you with this! I am very grateful for your help, I will have to buy you a beer at Lithy Awards '17 if you're going to the London event.