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 Commented Oct 29, 2024 at 16:23

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.