Page 1 of 1

Count function on Many to Many field

Posted: Thu Jan 27, 2011 1:22 pm
by eclectus
I am trying to use the Count function on a Many to Many field. It seems to work if there are selected items in the field, however when I filter based on Count with value 0 (zero) trying to determine is there are no selection for the field, I don't think it works.

If Count does not return 0 for an empty Many to Many field, is there another way to determine if the field is empty?

Re: Count function on Many to Many field

Posted: Sun Jan 30, 2011 1:25 pm
by ZevToledano
It works for me. Please describe in detail how you are using the function and what is happening.

Re: Count function on Many to Many field

Posted: Sun Jan 30, 2011 9:23 pm
by eclectus
I create a new automation. I select the Filter as my many to many field, and limit its value from 0 to 0. Then I add an action to Set Field of my text field to 'Any Item' (I have two other automations - one that checks this field for values 1 to 1 and then Set Field to the name of the item selected, the other checks for value 2 to 99999999999 and then Set Field to the 'count' value and some text i.e. '8 Items'. Both the automations work, but when I clear items from the many to many field, and expect the text field value to be 'Any Item' the field simply clears and no text is shown.

Re: Count function on Many to Many field

Posted: Sun Jan 30, 2011 9:32 pm
by ZevToledano
I recreated something similar on my end and it works.

If the field clears when you clear the many-to-many field and save the record, then that means that an Automation IS running and the filter has passed - it's just not setting it to the correct value. Double check your automation actions, make sure no other automation is clearing the field after the value is being set (use the History feature and/or the Automation verbose debug setting to track down what is happening).