1

I am trying to query a SharePoint list where I need to pull the last name (title), first name, email, and replacement name by filtering on the last name (title) and first name to make sure we have the correct person.

The request URL:

https://graph.microsoft.com/v1.0/sites/company.sharepoint.com:/sites/samplesiteid:/lists/%7Bsamplelistid7D/items?expand=fields%28select%3DTitle%2CFirstName%2CEMail%2CReplacement_x0020_Name%29&filter=fields%2FTitle%20eq%20%27SQ789%27%20and%20EMail%20eq%20%27Shannon%27&select=id

I get the 500 error:

{
    "error": {
        "code": "generalException",
        "message": "General exception while processing",
        "innerError": {
            "date": "2023-04-13T18:47:56",
            "request-id": "30e04301-a273-4aa0-bd7c-5fdbf9ca842b",
            "client-request-id": "30e04301-a273-4aa0-bd7c-5fdbf9ca842b"
        }
    }
}

This error message is not helpful.

I am able to successfully get all the information when I have only one filter (i.e. Title eq 'SQ789'). As soon as I added the 'and' condition and the filter on the first name, I started getting the error.

Both last name (title) and first name are indexes. There is a full name column in the list, but it is a calculated column. If I could filter this column, that would be ideal but I have not seen any way to do that on a calculated column. I was not able to make it an index.

Based on the documentation, it seems like this should not be a problem, but I have not been able to make it work.

3
  • What is the column type of "first name" column, single line of text or something else? Commented Apr 14, 2023 at 7:25
  • 1
    Can you try using this: https://graph.microsoft.com/v1.0/sites/company.sharepoint.com:/sites/samplesiteid:/lists/{samplelistid7D}/items?expand=fields(select=Title,FirstName,EMail,Replacement_x0020_Name)&filter=fields/Title eq 'SQ789' and fields/FirstName eq 'Shannon'&select=id. Let me know if it works for you. Commented Apr 14, 2023 at 7:27
  • 1
    Yes that worked! Looks like I was missing the fields/FirstName after the 'and'. Thank you!
    – shannon
    Commented Apr 14, 2023 at 11:37

1 Answer 1

1

As you want to filter list items based on FirstName column, try using request URL in this format:

https://graph.microsoft.com/v1.0/sites/company.sharepoint.com:/sites/samplesiteid:/lists/{samplelistid7D}/items?expand=fields(select=Title,FirstName,EMail,Replacement_x0020_Name)&filter=fields/Title eq 'SQ789' and fields/FirstName eq 'Shannon'&select=id

Documentation: Use the filter query parameter

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.