Closed daxkellie closed 5 months ago
The output of show_values() appears to be formatted after it is retrieved, which makes it look nice, but if you use the values shown by the output of show_values() for the field basisOfRecord, your query won't work.
show_values()
basisOfRecord
search_all(fields, "basisOfRecord") |> show_values() #> ! Search returned 2 matched fields. #> • Showing values for 'basisOfRecord'. #> # A tibble: 9 × 1 #> basisOfRecord #> <chr> #> 1 Human observation #> 2 Preserved specimen #> 3 Observation #> 4 Occurrence #> 5 Machine observation #> 6 Material Sample #> 7 Living specimen #> 8 Material Citation #> 9 Fossil specimen galah_call() |> identify("Daviesia ulicifolia") |> filter(basisOfRecord == "Human observation") |> atlas_counts() #> # A tibble: 1 × 1 #> count #> <int> #> 1 0
The actual values for basisOfRecord are in all caps and separated by an underscore, which when used, return the correct result.
galah_call() |> identify("Daviesia ulicifolia") |> filter(basisOfRecord == "HUMAN_OBSERVATION") |> atlas_counts() #> # A tibble: 1 × 1 #> count #> <int> #> 1 14446
Created on 2024-03-06 with reprex v2.0.2
I'm not sure whether this is true for all show_values() results, and whether it is the same for search_values() as well.
search_values()
The output of
show_values()
appears to be formatted after it is retrieved, which makes it look nice, but if you use the values shown by the output ofshow_values()
for the fieldbasisOfRecord
, your query won't work.The actual values for
basisOfRecord
are in all caps and separated by an underscore, which when used, return the correct result.Created on 2024-03-06 with reprex v2.0.2
I'm not sure whether this is true for all
show_values()
results, and whether it is the same forsearch_values()
as well.