If function not working?

Hi,

I’m practicing with one of your templates but the if function doesn’t seem to be working.

I would like to show there are 0 comments related to the PWA support feature.

What am I doing wrong?

1 Like

Hi Lisa! :wave:

Can you elaborate?

Yes, of course!

I was following your template called “Onboarding” with the list of tickets and upvoting system and wanted to add:

  • the sum of the upvotes on the left under the arrow and

  • the sum of the comments on the right above the date like in your example.

I managed to do it with the upvotes by binding the length of the collection:

But I am not able to do it with the comments.

When I try to bind the length of the comments collection, I get this error message:

Hi Lisa !

The item.data["Comments"] that you are trying to bind is empty.
You can see in your screenshot that Comments has no value (in the Quick access).

It should work if you change your formula to :
if( item.data["Comments"] , length( item.data["Comments"] ) , "0")

1 Like

Unfortunately it doesn’t seem to work. I still have nothing for “PWA support”

Do not copy / paste the formula I gave you, but write it from scrach :wink:
The copy / paste don’t work well for now but should be corrected this week.

It should work !

1 Like

Thank you! It’s working now.

The mistake I made is that I was typing length inside the formula field instead of selecting the function in the function’s tab.

1 Like