Archive
Posts Tagged ‘Urlencode’
[Quick Tip] Dataverse Web API | Handling special characters in Filter query
February 28, 2023
1 comment
In this quick tip, lets see how to handle special characters while querying the Dataverse Web API.
Assume that you have a Dataverse Team with name CoE&Feb&Makers as below and you would want to query the Team by ‘Team Name’ using Dataverse Web API.
Query Dataverse Web API:
- To query the ‘Team’ record with name CoE&Feb&Makers using Web API, we can form the URL as below and execute from the browser.
- When you hit the URL, you will get an exception that ‘The query parameter is not supported‘. This is because the team name CoE&Feb&Makers is having & symbol, which is not supported.
- To fix this, you need to encode the team’s name. You can use online editor to encode, if you are querying the Web API from browser.
- Now use the encoded value CoE%26Feb%26Makers in the Filter and you should get the result.
- Use HttpUtility.UrlEncode method to encode, if you are querying the Dataverse Web API using C#.
🙂
Categories: Dataverse
Dataverse, Special Characters, Urlencode