How would I add a second condition to a query using a .filter that returns list items from SPO

Viewed 20

I have an existing filter that successfully returns list items with the matching Id when a user enters a number into a field:

sp.web.lists.getByTitle("MyItems").items.filter("Id eq '" + sid + "'").get()

But I want to filter any items which contain the word Appeal in a column called JobRef as well as it using the above filter when a number is typed in.

Here is my attempt which it says it can't find the word 'and':

 sp.web.lists.getByTitle("MyItems").items.filter("JobRef eq 'Appeals'"and"Id eq '" + sid + "'").get()

Obviously the syntax is wrong.

To clarify:

A user enters a number into a field on a form. The list below it is then filtered to show the number that matches. The filter uses the number entered to match with the Id of the item in the list. I require that when the user enters the no. that they want to find, it not only filters on the Id number but only searches items that contain the word 'APPEAL' in a column called JobRef.

I have read:

0 Answers
Related