Proper way to get items from a sharepoint list?
I was just wondering what is the correct way to get items from a sharepoint list. I have used For loops but I was wondering if the CAML queries provided an easier method for accessing list items. More specific to my challange, I am trying to get the "Assigned To" In a task list and compare it with the sharepoint site's employee list, to send out automated emails to a the appropriate person with the appropriate task.

Any advice?


Thanks,

George
February 23rd, 2009 3:23pm

Hi,
you should use CAML queries. This is the most efficient way performance wise. It may look a bit weird to start with compared to the for/foreach and the object model, but once you get your hands on it you can make more efficient and powerful queries.
/WW
Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2009 3:52pm

Hi George,

Have you read the "working with large lists whitepaper"http://technet.microsoft.com/en-us/library/cc262813.aspx. I would agree with Wictor, CAML is a efficient way of retriving one or more lists items.

Thanks

Dave

February 25th, 2009 1:34pm

I did some testing and found that for small lists, looping was quicker - but CAML is normally the way to go.
Free Windows Admin Tool Kit Click here and download it now
February 25th, 2009 2:30pm

I agree in most of the case CAML works great but if your automated process is going to run in batch mode then you can also give a try to SPListItemCollection's GetDataTable method once you have DataTable you can cache it forthe time your process is running and query data directly from the DataTable.

March 2nd, 2009 10:29pm

CAML is definitely more efficient, especially as you get larger numbers of items in the lists. Once you start using CAML you will find that it really is very powerful. Just watch out for those AND elements.
Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2009 2:45pm

+1 CAML is a way to go.

When you are dealing with large list try specifying RowLimit in your CAML Query.
March 3rd, 2009 2:54pm

You can also get items using Call Http service action in workflow manager, below link might help you to understand better

https://zareensoomro.wordpress.com/2015/07/02/get-items-from-sharepoint-list-using-call-http-web-service-action-sharepoint-designer-2013/

Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2015 1:01am

You can also get items and perform multiple operations on it using Call Http service action in wworkflow manager.

https://zareensoomro.wordpress.com/2015/07/02/get-items-from-sharepoint-list-using-call-http-web-service-action-sharepoint-designer-2013/

July 3rd, 2015 1:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics