0

I am building a people results in display template that needs to include a link to an individual's CV in a document library. I've used a SPServices Getlistitem to query the list, but I can't get the CurrentItem data to work in a CAML query. What I need to do is something like the below (which isn't working):

CAMLQuery: "<Query><Where><Contains><FieldRef Name='LinkFilename' /><Value Type='Text'>_#= ctx.CurrentItem.PreferredName =#_</Value></Contains></Where></Query>"

Any suggestions as to what I'm doing wrong or if this is even possible?

1 Answer 1

0

Rather than CAML, why not use the search API. For example, if you use a content type for the CV, you could fire a second query from your display template using the search REST API to find the content ContentType=CV.

2
  • Thanks for the suggestion Matthew, I've used the REST API and am getting results back, but all 10 CV links are being listed under the first person that's returned in the search results, rather than 1 CV for each of the 10 search results. More work to do - any suggestions?
    – PaulB
    Jun 27, 2016 at 11:02
  • Without seeing the results it's hard to say. Jun 27, 2016 at 15:23

Your Answer

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

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