Using Keywords in Queries
Because keywords contain consistent values unlike text fields, keywords are the most common fields used to query fields within objects, except when the fields are numeric or date fields.
You must use the Keyword Item Alias to perform queries against keywords in JavaScript. The Keyword Item Alias is the actual value written to the data source, not the value displayed to users on the mobile device. Check the Keyword Item Alias if you plan to use a keyword to ensure that you are using the correct values.
To view Keyword Item Alias information in the Admin application
- In the Admin application, click Keywords.
- Locate the keyword that you want in the Keyword Names list.
- Click the keyword to display its values in the Keyword Item Alias column.
- The Keyword Items column shows the keyword that is displayed to the user on mobile devices.
- The Keyword Items Alias column shows the actual keyword value that is written to the data source
The keyword value that is displayed to users (Keyword Items column) might be different to the keyword value that is written to the data source (Keyword Items Alias column).
When using JSON, you may use the keyword display value if you use formatquery\":\"no\" as part of your JSON function, such as:
return "[ {\"action\":\"getcondition\",\"formatquery\":\"no\",\"filter\":\"PIPEREF2 in (select uid from medata_11 where CUSTDESCRIPTION = 'Selected' )\" } ]";
As stated above, for JavaScript, you must retrieve the Alias.