0

I have a column in my SharePoint list, named "Catégorie", that is a multiple choice column, where I have multiple options "Option 1", "Second Option" etc.

How should I filter on that column if I want to check if "Second Option" was selected (among others)?

Actually my query is

const baseQuery = "IsDocument:True AND FileExtension:aspx AND Cat_x00e9_gorie:'Second Option'";

but it does not seem to filter anything, I have 0 items when filtered.

1 Answer 1

0

For a multi-select choice column, you can use the $filter query option with the substringof function. Here’s an example of how you might structure your query:

const query = https://{site_url}/_api/web/lists/getbytitle('YourListName')/items?$filter=substringof('Second Option', Catégorie);

This query checks if "Second Option" is part of the "Catégorie" field. Make sure to replace {site_url} with your actual SharePoint site URL and YourListName with the name of your list.

If you're still getting 0 items, ensure that:

  • The column name is correctly spelled and matches exactly with what is in SharePoint.

  • The value "Second Option" is indeed present in the items of the list.

1
  • Your code does not seem to be a valid JavaScript
    – serge
    Commented Oct 29 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.