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 +

3
  • Have you tried character escaping such as encodeURI?
    – Aveenav
    Commented Feb 5, 2015 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
    Commented Feb 6, 2015 at 9:16
  • I also tried encodeURIComponent also but no success.
    – Manish
    Commented Feb 6, 2015 at 9:20

1 Answer 1

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 and acknowledge you have read our privacy policy.

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