1

This CAML query is not working if Title field contains Plus (+) Sign.

My query is :

function createSACQuery(Title) {
        var qry = new SP.CamlQuery();
        qry.set_viewXml('<View Scope="RecursiveAll"><Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text"><![CDATA[' + Title + ']]></Value></Eq></Where></Query></View>');
        return qry;
    }

My Title is Lorem Ipsum +

  • Have you tried character escaping such as encodeURI? – Aveenav Feb 5 '15 at 21:50
  • Yes i tried but it is also not working infact after using encodeURI i am getting no result which i am getting from my above query. – Manish Feb 6 '15 at 9:16
  • I also tried encodeURIComponent also but no success. – Manish Feb 6 '15 at 9:20
1

I found a solution, I was fetching value of title from querystring so it automatically removes the Plus(+) sign.

So I created the url like this www.abcd.com/default.aspx?Title=encodeURIComponent(mytitle)

It is working fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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