Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add, update and query SharePoint list items from CSOM using javascript

Using javascript and SharePoint's CSOM, can someone provide an example for the follow scenario:

Get field value from the selected items in a list (ListA).

Then for each item selected, take a fields value and use it to query a different list (ListB).

If the query returns 0 rows, create item in ListB and update selected item in ListA.

Else if the query returns 1 row, update selected item in ListA.

like image 657
pbenemy Avatar asked Jul 26 '26 12:07

pbenemy


1 Answers

This will get you started.

MSDN - How to: Complete basic operations using JavaScript library code in SharePoint 2013

It gives examples of how to

  • Query lists and get value
  • Add/update and delete records
  • and many others common operations

So, most of what you need to complete your scenario.

like image 142
Ryan Avatar answered Jul 29 '26 01:07

Ryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!