Tag Info

Hot answers tagged


Add a calculated column to your list. Calculate the length of the field you want using LEN(Field) and return as number. This then boils down to just querying the calculated column using CAML query. Orderby by descending and and set rowlimit as 1. You will get the item with the field with most characters.


It would look like this (from memory): var camlQuery = new SP.CamlQuery(); var textCAML = "<View><Query><Where><Eq><FieldRef Name='Author' LookupId='TRUE'/><Value Type='Integer'><UserID/></Value></Eq></Where></Query></View>"; camlQuery.set_viewXml(textCAML);


You can use <Contains> condition with CAML and filter on ContentTypeId column pass the value of "LanguageItem" ctype ID. You can also use BeginsWith <BeginsWith><FieldRef Name="ContentTypeId"/><Value Type="Text">ctypeID</Value></BeginsWith>


Your looping code is probably running before the SPServices call is complete. You're using SPServices version 0.7.1a, and the current version is 2014.02. The difference is significant in that SPServices now uses deferred promises so that you can wait to use the returned data until it's done being fetched. First you get the promise, then once it's done, you ...


You can use <IsNotNull> to check for non-null values in caml query. You can try below query: <Where><IsNotNull><FieldRef Name='Link' /></IsNotNull></Where>


Yes, you can look though all lists and get list items one by one. var clientContext = SP.ClientContext.get_current(); var web = clientContext.get_web(); var lists = web.get_lists(); clientContext.load(lists); clientContext.executeQueryAsync(function () { var enumerator = lists.getEnumerator(); var listItemsCollection = []; while ...


Using JavaScript Object Model, if you need to retrieve value and link of a column of type Hyperlink then following methods are used. get_description(): It will fetch the description of the link you have given get_url(): It will fetch the URL. Note: The method which you have used is correct, in case you do not get values in it, then you must check the ...


There are multiple errors in the query: You don't need Value in OrderBy You have IsNotNull inside Eq You have Ascending attribute in FieldRef for IsNotNull You have no values in Eq conditions. Consider using IsNull (unless you've just omitted values in the question). Try this one: <Query> <Where> <Or> <Or> <Eq> ...

Only top voted, non community-wiki answers of a minimum length are eligible