0

I am trying to update share point list item using rest api.

I can update Item using ID but I want to Update that item which column Name Title is like "DA5000" its unique field so can I do this ?? if yes then how to achieve this..?

I was try to update using ID its work well but I want to Update using title item value

Any Help will Appreciated

Thanks in advance..

  • 1
    Could you add some Background as to why you want this? Might give more and possibly better solutions – Raoul Mensink Apr 14 '16 at 8:24
0

Well, it depends how you are getting the item.

If you are getting it via the URL like this:

/_api/lists/getbytitle('News')/items(50)

Where the number in the brackets "(50)" is the item ID you can get an item e.G. like this:

/_api/lists/getbytitle('News')/items?$filter=Title eq 'FAQ'

So the URL is looking for an item, where in the title column FAQ is the content.

In general:

/_api/lists/getbytitle('<ListName>')/items?$filter=<InternalColumnName> eq '<Value>'

To check the internal column names you can just use this:

/_api/lists/getbytitle('<ListName>')/items

Then use that name for the in the filter.

Hope this could help.

  • I was tried it but its give 400 bad request error – Vishal Thakkar Apr 14 '16 at 7:54
  • updated answer. Could you add the output of that (the column you want to filter) in your question? – Patrick Apr 14 '16 at 7:59
  • patrick i want to filter title column. have you try to update like this before? is it work? – Vishal Thakkar Apr 14 '16 at 10:32
  • actually in my when i approve in my one list then one random unique string generate and add in this list.so i don’t have that item ID .but i have that string so i want to update on that. – Vishal Thakkar Apr 14 '16 at 10:35
  • Didn't tried it, but if you get the item via /_api/lists/getbytitle('News')/items?$filter=Title eq 'DA5000' you also get the ID of the item. Check the xml output. So I guess there should not be a problem. – Patrick Apr 14 '16 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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