Skip to main content

Im trying to count the number of times on a page that a certain string is there. 

All the shapes are not connected to each other, they are individual

 

this is what i have tried so far but i don’t think its getting me any closer

 

{{=count(FILTER(PAGE.DESCENDANTS, contains(@"Length", "50")))}

 

I have a data field attached to the shapes with the name ‘Length’ from a google sheet.

Im happy to either pull the string from there or from the actual displayed string

Good afternoon Luke,

I checked with some of our Lucid Formula experts, and the agreed on solution is to just switch PAGE.DESCENDANTS to DESCENDANTS(PAGE) . You also want to make sure that the field name you are pulling from matches exactly (no additional spaces or characters). Here are some possible ways you can write the formula.

=COUNT(FILTER(DESCENDANTS(PAGE), x => AND(ISNOTERROR(x."Length"), x."Length" = "50")))

  • The (ISNOTERROR) is probably not strictly necessary, but it can be useful doing checks that the properties exist.


=COUNT(FILTER(DESCENDANTS, x => CONTAINS(x."Length","50")))

 

=COUNT(FILTER(DESCENDANTS(PAGE), x => contains(x."Length", "50")))


Let me know if this helps! 


Thankyou, this works perfectly

=COUNT(FILTER(DESCENDANTS, x => CONTAINS(x."Length","50")))

 


Reply