keyword with apostrophe - API use
AnsweredHi there! I am a developer using Vault Query Language. In the API, we try to search on keywords with an apostrophe in CVs. For example: "Alzheimer's Disease". Does anyone know of a way to format our search so keywords with apostrophe's are detected via the API?
here is what we tried so far in defining the veeva query function (specifically line 5):
veeva_query_f <- function(session_id,
api_version,
base_url,
keyword){
keyword_clean = str_replace(keyword, " ' ", "\'")
keyword_clean = str_remove_all(keyword_clean, '"')...
-
Official comment
The FIND() clause can be used in VQL to search for keywords. If the keyword in the FIND() clause contains an apostrophe, the apostrophe needs to be escaped.
https://developer.veevavault.com/vql/#find
https://developer.veevavault.com/vql/#special-characters
Example Query:
SELECT id, name__v
FROM test_object__c
FIND('Alzheimer\'s Disease')
As for returning all keywords that contain an apostrophe through VQL, that is not supported. Partial searches can be done using a wildcard, but leading wildcards in the FIND() clause put your vault at risk for performance issues, and they are not supported from v22.3 forward.
https://developer.veevavault.com/vql/#using-the-wildcard-character
https://developer.veevavault.com/vql/#leading-wildcard-on-find
It's also worth considering using the SCOPE option with the FIND() clause to improve search performance. With SCOPE, the search can be limited to certain areas, such as document content or a specific field.
https://developer.veevavault.com/vql/#find-scopes
Please sign in to leave a comment.
Comments
1 comment