Forum Discussion

jaread83's avatar
jaread83
Champion
8 years ago

Total Kudos Givers

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...
  • TariqHussain's avatar
    TariqHussain
    8 years ago

    jaread83 - Found two errors in your query . 

     

    <#assign kudosCount = rest(apiVersion,"/search?q=" + "SELECT * FROM kudos where message.id = messageId limit kudosCountFirst"?url).data.items![] />

     

    messageId and kudosCountFirst are treated as string as you must need to wrap freemaker variable with ${}. Second you need to wrap messageId in quotes.  

     

    Updated Query : 

    <#assign kudosCount = rest(apiVersion,"/search?q=" + "SELECT * FROM kudos where message.id = '${messageId}' limit ${kudosCountFirst}"?url).data.items![] />

     

    PS : I don't drink beer :smileyvery-happy:

     

    Give kudos if you find my posts helpful or mark solution if it answers your query.

    Tariq