Home › Forums › SPJS-Utility › Is there any documentation for SPJS-Utility functions
- This topic has 2 replies, 2 voices, and was last updated 8 years, 9 months ago by Jeff Law.
-
AuthorPosts
-
-
March 19, 2016 at 05:14 #10801
Hi,
I was just wondering if there was any documentation on SPJS-Utility functions. I haven’t been able to find anything (I may need extra tuition on how to use search :-))I have a requirement to add information from some other lists, which all share a common “ID” field, onto a new tab in the “master” list. There are currently 5 of these lists that I need to query, and display information from. Once displayed, then this info can be printed.
I have found reference to the spjs.utility.queryItems function which sounds like it will do all the heavy lifting for me, but I am not sure of the best way to drive it, so was looking for some reference, or an example.
Regards
Jeff -
March 20, 2016 at 16:30 #10826
Hi,
No, I have never gotten around to document these functions, but the queryitems function can basically be used like this:var res = spjs_QueryItems( { "listName":"DFFS_TestList", "listBaseUrl":"/DFFS", "query":"<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Test</Value></Eq></Where>", "viewFields":["ID","Title","Author","Created"] } ); $.each(res.items,function(i,item){ console.log(item.Title+" was created on "+new Date(item.Created).toLocaleDateString()+" by "+item.Author.split(";#")[1]); });
Change the parameters “listName”, “listBaseUrl”, “query” and “viewFields” to match your setup.
When this is said, It sounds like you might be better off using vLookup? – have you looked at this options?
Alexander
- This reply was modified 8 years, 9 months ago by Alexander Bautz.
-
March 21, 2016 at 10:10 #10843
Thanks Alexander. I’ll give this a go.
I have used vLookup in another place, but what I was looking for was something that I could easily use some custom css/html to format the fields in a specific way. The ideal output that gets printed would look something like a fully “branded” certificate.
I haven’t looked to hard at what I can do with regard to the output of vLookup, so it is an option. At least if I can get the info using the QueryItems, then I can use that as a starting point/fallback position.
I’ll let you know how I go, and once again thanks for you response.
Regards
Jeff
-
-
AuthorPosts
- You must be logged in to reply to this topic.