0

Filtering select statements with “choice" fields

This select statement doesn’t work;

select inventory[category = "Oil"].item

when category is choice field but it does when it’s text... 

is it possible to do this with choice fields? I tried category.value and category.value but those don’t work.

2 replies

null
    • Sean
    • 4 yrs ago
    • Reported - view

    You can do it using the text() function...

     

    (select inventory where text(category) = "Oil").item  or

    (select inventory)[text(category) = "Oil"].item

    • Rob.1
    • 4 yrs ago
    • Reported - view

    ahh. so you have to cast "category" to text for choice fields? Worked perfectly. Thank you.

Content aside

  • 4 yrs agoLast active
  • 2Replies
  • 2280Views