Welcome to Catalog Tips
Search more than 200 articles to learn more about creating and automating your product catalogs
Tip: Start typing in the input box for immediate search results.
COUNTOF – Count string instances
Overview
This Custom Field counts the number of instances of one specified string inside of another.
Syntax
COUNTOF(FIELDSTR(Description),‘Bl’)
Example
| Element | Description |
|---|---|
| FIELDSTR(Description) | The string to search in. |
| String | The string to search for. |
COUNTOF(FIELDSTR(‘Colours’), ‘Bl’)
In the following list of colours, the above Custom Field query will return the following:
| Colours | COUNTOF(FIELDSTR(‘Colours’), ‘Bl’) |
| Green | 0 |
| Dark Green | 0 |
| Grey/Green | 0 |
| Blue | 1 |
| Black/Blue | 2 |
| Grey/Blue | 1 |
| Yellow | 0 |
| Grey | 0 |
| Black | 1 |
COUNTOF(FIELDSTR(‘Colours’), ‘Gre’)
In the following list of colours, the above Custom Field query will return the following:
| Colours | COUNTOF(FIELDSTR(‘Colours’), ‘Gre’) |
| Green | 1 |
| Dark Green | 1 |
| Grey/Green | 2 |
| Blue | 0 |
| Black/Blue | 0 |
| Grey/Blue | 1 |
| Yellow | 0 |
| Grey | 1 |
| Black | 0 |
See also
