Expand my Community achievements bar.

SOLVED

External reference field / filtering out multiple status options

Avatar

Level 2

Hi All,

I'm trying to filter out Complete and Cancelled projects from the list of projects showing up in an External Lookup type custom field.

(I use External Lookup, instead Typeahaed, because I want to use another field's value as a filter.)

Here's how the Base API URL looked like so far - it was working fine (although no status filter was included):

$$HOST/attask/api/v19.0/project/search?program:name={DE:<my-other-field>}&name=$$QUERY&name_Mod=cicontains&name_Sort=asc

This is what I've tried, to achieve my current goal:

$$HOST/attask/api/v19.0/project/search?program:name={DE:<my-other-field>}&status=DED,CPL&status_Mod=notin&name=$$QUERY&name_Mod=cicontains&name_Sort=asc

This is not working, nothing is filtered out.

So, I've tested a few more things:

  • status=DED&status_Mod=ne -> Works.
  • status=CPL&status_Mod=ne -> Works.
  • status=DED&status_Mod=notin -> Works.
  • status=CPL&status_Mod=notin -> Works.
  • status=DED,CPL&status_Mod=ne -> Doesn't work.
  • status=DED&status_Mod=ne&status=CPL&status_Mod=ne -> Doesn't work.

If anyone has an idea how to filter out both complete and cancelled projects, I appreciate the help.

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hello Tibor,

 

derived from the text mode for filters, you will need to use the modifier notin instead of ne.

In text mode this would look like this:

status=DED CPL
status_Mod=notin

 

Unfortunately I currently do not know, how to pass the array of statuses as one query parameter, but what you can do is the following:

.../search?status=DED&status=CPL&status_Mod=notin

 

 

Regards

Lars

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hello Tibor,

 

derived from the text mode for filters, you will need to use the modifier notin instead of ne.

In text mode this would look like this:

status=DED CPL
status_Mod=notin

 

Unfortunately I currently do not know, how to pass the array of statuses as one query parameter, but what you can do is the following:

.../search?status=DED&status=CPL&status_Mod=notin

 

 

Regards

Lars

Avatar

Level 2

Hi Lars,

thank you for the swift response.

Yes, it's clear that I need the qualifier notin (instead of ne), and that was the very first thing I did. I only tried ne, because I wasn't able to figure out how to get notin working with multiple values.

And yes, the question is ultimately how to pass an array of options in a query string. I tried coma (,) and semicolon (;) as separator, but neither of those worked. - I wonder if anyone can answer this.

Your workaround (status=DED&status=CPL&status_Mod=notin) does work though.

Thank you,

Tibor