1

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
  • 1
    Could you add some Background as to why you want this? Might give more and possibly better solutions Apr 14, 2016 at 8:24

1 Answer 1

1

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.

8
  • I was tried it but its give 400 bad request error Apr 14, 2016 at 7:54
  • updated answer. Could you add the output of that (the column you want to filter) in your question?
    – Patrick
    Apr 14, 2016 at 7:59
  • patrick i want to filter title column. have you try to update like this before? is it work? Apr 14, 2016 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. Apr 14, 2016 at 10:35
  • 1
    As Patrick mentions in his answer, you need to do two REST calls. First to get the ID of the item, then to update.
    – Submits
    Apr 14, 2016 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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