REST - GetChoiceLineId
Select, or used in the query text when linking to other tables in linked field sets.The EWGetChoiceLineID operation is used to retrieve the internal ID for a choice value, which can be used in SQL-based expressions. It returns the identifier of the choice list element. This can be used for the "where" parameter in operations like
- Returns: the ID of the choice list element.
- Supported Content-Type: application/x-www-form-urlencoded
- Accepts a URL with URL-encoded parameters and record data. For more information about general URL conventions, see REST Interface.
- Additionally, the URL must contain the name of the choice field and the choice list element value.
SQL-based expressions are evaluated on the database level where choice values are stored as identifiers. These identifiers change if the knowledgebase is copied or re-imported, or the values in the choice list are re-created. It is therefore advisable to use this operation to obtain the ID value at runtime, immediately before the SQL call.
If the factors that trigger the change of the internal choice identifiers, such as knowledgebase copy or re-import, or choice list values are re-created, are detected on the client, then the values returned by this call can be safely cached on a per KB basis between multiple calls.
Assume an instance of Agiloft is available on localhost, port 8080 and is called "Demo". Obtain the identifier for choice value 'High' for the field 'Priority' in the table 'Case'.
The following request is issued:
If there were no matching choice list values found, the HTTP code 400 will be returned with a brief explanation of the problem.
The following result will be returned in the case of the text value being successfully translated into a numeric identifier: