How to search for multiple fields with an OR boolean

I see theres a feature request for this https://forum.inaturalist.org/t/use-or-boolean-logic-in-url-searches-for-observation-field-values/47924 which has been approved but not implemented (afaik), i was wondering if anyone knows any workarounds that would allow to search for both (for example) &field:Plant%20mine=flower%20mine OR &field:Plant%20mine=stem%20mine on the same search page?

Thanks in advance!

There’s no direct method that I know of, but you could create two separate projects. One for value X and one for value Y. Then you can either search by “included in project” or group them under an umbrella project to use as your overview or ID module.
Would be my approach, I think.

It doesn’t work the same way as it does with place IDs or so. Sadly. (To the comment above// edit: it’s gone lol)

1 Like

how does having this on the same page help you? it looks to me like “flower mine” brings back 2 observations, and “stem mine” brings back 1 observation. for such small sets, you could just do something like id=1,2,3, but there might be better options, depending on why you’re trying to do this.

For some reason that doesn’t work here for fields, e.g. https://www.inaturalist.org/observations?verifiable=any&place_id=any&field:Plant%20mine=flower%20mine,stem%20mine

observation fields are different from most other filter parameters. when i talked about doing something like id=1,2,3 that’s using the observation id parameter, not an observation field parameter.

I might be able to tweak something I already have. It’s a little app I wrote for fishing Lifelists. It allows you to toggle between different “fish observation methods”… which correspond to individual values for that observation field. If you hover over “method” at this link, what it’s displaying is observations for each individual value for that obs field…

https://stockslager.github.io/iNat/life_list.html?project_id=239695&user_id=stockslager

I think this is kinda sorta close to what ur asking for. it makes u toggle tho. It also expects a project so I’m just passing it the project for all of europe.

https://stockslager.github.io/iNat/bugs_on_plants2.html?project_id=77182&title=hide&field:Plant%20Mine=&target_name=all+plants&params=bugs_europe

This was just an example really, If you want specifics I was trying to find out if this could be done before implementing a field that I could add to many observations (hydrozoa gonophore presence) to help filter out hydromedusae from hydroid colonies and their different levels of gonophore reduction, which is where the ability to search for multiple at the same time would be helpful. I would just add a simple ‘medusoid or hydroid’ field but this would be inaccurate and would miss many edge cases.

This is a cool project! - but you could just change the inaturalist search URL between the multiple field values, similarly to this? I’d really want to be able to use this in the identify page on iNaturalist too…

Here’s another option (this one looks better on a pc than a phone). I’d need to modify it to allow selection of different plant mines…. Otherwise you’d need to Page through to find the mine you’re looking for to click on.

also ~ not sure what you mean by “use this in the identify page”…

https://stockslager.github.io/iNat/configurable_obs_field_table.html?project_id=77182&obs_fields=254,12593&field:plant+mine=

i’m not sure i fully understand what you’re describing regarding edge cases, but if you have a field f that has only two possible values v1 and v2, then filtering for (f=v1 OR f=v2) would be equivalent to filtering for the presence of f. the syntax for that filter would be field:f.

if you need to also record and filter by level of gonopore reduction, then you probably should add a second field.

Yeah its quite a niche field… f would have at least 4 possible values and I would be wanting to search for 1 or 2 or more at a time.

Hydromedusae are a form of gonophore (the least reduced forms) which is why there’d be 1 field with multiple stages of reduction.

i don’t understand this stuff, but it still sounds to me like you need 2 fields:

  1. medusoid or hydroid
  2. level of gonopore reduction

the way i think you’re describing things, the second observation field f2 essentially would be a subcategory of f1=medusoid.

so if you have the setup described above, you would be able to differentiate at a high level between medusoid vs hydroid using f1 and/or by a single level (range) of gonopore reduction using f2.

Yeah that makes more sense and is easier than any other workaround so far, having both a colloquial field and a specific field.

Still though there are observations with focus on both the medusoid and hydroid (i.e.), so a ‘medusoid’ or ‘hydroid’ field would need a third option for ‘both medusoid and hydroid’, then you’re back to needing to search for two field conditions at once: i.e. ‘hydroid’ OR ‘both medusoid and hydroid’.

i think you could handle this using two fields:

  • medusoid? yes/no
  • hydroid? yes/no

then have the third gonopore reduction level field.

1 Like

yeah! Messy, but workarounds are… thanks!

based on what you described, i don’t think this is even a workaround. i think it’s just the best way to capture what you’re wanting.

I still don’t think it supports field:medusoid=yes and field:hydroid=yes for the third option for ‘both medusoid and hydroid’. but maybe i’m misreading something. there’s no way to and the two obs fields together when they both have values of ‘yes’.

have you actually tried to filter by two observation fields? why do you think field:medusoid=yes&field:hydroid=yes wouldn’t work?

Ugh. Yes, my mistake. Sorry.