I am trying to extract the ListItem ID
of a List which I am currently NOT in based on a field value in that List. I cant find anything that explains how to do this.
So, to explain. I have a Custom List called 'Department'. I have another Custom List called 'Article'. I have a field in the 'Article' List which is a Lookup to the 'Title' field in the 'Department' List
I have some JavaScript which reads the DispForm of an 'Article' in the 'Article List' and pulls out the Department as a text string. Now using this text string I want to use JavaScript to look in the 'Department' List, find the 'Title' field value which matches the text string (e.g. Finance) and return the Item ID of this List Item.
All solutions I can find on the web connect to the List using the 'getItemById' method, but I don't know the ID as that is what i'm trying to return (e.g. below)
var ctx = SP.ClientContext.get_current();
this.web = ctx.get_web();
this.list = web.get_lists().getByTitle("Department");
this.listItem = list.getItemById(x);
Can anyone point me in the right direction on how I would go about doing this?