Negation or distinct options?

I’m trying to find any items where the item name doesn’t match a list I have on my server, ie someone has manually added something that shouldn’t be there.

I would expect to do this with a negation query along of:

item[‘name’] not in [‘bob’, ‘fred’, ‘harry’]

or get a list of unique item names which I could then compare on the server and then use to pull the data from the board, something like:

DISTINCT item[‘name’]

I can’t find any negation or distinct functions to the API. Are there any?

(I suppose that I could create a status field and then query the labels, but I really don’t want to use a status field as it isn’t appropriate)

youre going to probably have to run a query that gets all board items, and do the operation in code on the results.

query {
        boards (ids: 123456789101) {
            items {

then use whatever method you want to use to filter those results in code.

1 Like

Ouch. In the long run there are going to be potentially thousands of lines, so that’s not going to be nice at all. Thanks anyway. At least I’m not missing some obvious functions then!

I’d recommend something like adding a valid/invalid status and then having on name change and item creation, to check if its a valid name, and then set the status on the item accordingly. Unless your list is very small.