0

I have constructed an URL like -

http://server_name/_vti_bin/owssvr.dll?Cmd=Display&List={List-Id}&XMLDATA=TRUE&View={View-Id}&Query=*&FilterField1=Country_x0020_Name&FilterValue1=UK & Ireland

which ofcourse doesnot give me the expected output. How to specify the filer value if there is an '&' character in the string? The filter value is retrieved from a sharepoint list that contains the list of countries

1 Answer 1

3

You need to encode the value of the filter parameter according to RFC 3986. If you're building the url using javascript, then you would do this using a call to encodeURIComponent(rawData):

var url = hostpath + "?Query=" + encodeURIComponent(filterValue);

This will take care of '&', spaces and other characters that would otherwise cause a problem. If you're hard-coding the URL, then you can use one of the many public access tools to see what the encoded value should look like, e.g. W3Schools.com

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.