Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2020-08-31 10:41 AM
Folks,
I am trying to get a list of all question fields in a questionnaire using the REST API (using the Archer Toolbox). When I query all properties returned by /api/core/system/fielddefinition/application, I see one called IsQuestion that seems to fit the bill to filter on. However, any filter I try using IsQuestion returns the error "Could not find a property named 'IsQuestion' on type 'ArcherTech.Common.Domain.FieldDefinition'." In fact, any of the Is<something> type properties return this error.
Am I doing this incorrectly? My filter is:
{
"Value": "?$orderby=Name&$filter=IsQuestion eq 1"
}
I've also tried false instead of 1. Same result.
If I filter on Name, the filter works, e.g.,
{
"Value": "?$orderby=Name&$filter=Name eq 'CT-01'"
}
Thanks,
Ron
2020-08-31 02:13 PM
Yes, the recommendation is to pull all field definitions for the application/level and filter the results.
A defect was logged as ARCHER-66403 and was closed as functioning as designed. Then a defect logged as ARCHER-67378 updated the documentation starting in 6.8. If you open the Archer Help, search for "Metadata" and scroll down to very bottom to see a note.
Metadata
Note: The following properties are allowed with the $filter, $select, and the $orderby actions in the OData query on the field definition resources available in the table above:
- Id
- LevelId
- Type
- Name
- Alias
- IsActive
- Guid
- ASOStatus
- SystemType
- IsPrivate
- IsContentReadOnly
- EsFieldMappingId
- UpdateInformation
- FieldMap
2020-08-31 12:23 PM
This occurs if the property is not assigned to all objects in the collection. In these cases, you'll need to filter the results in the code after getting the collection from API.
2020-08-31 12:32 PM
Filtering by field name does work:
Filtering the fields in the Control Standards application on 'Audience'
Advisory Consultant
2020-08-31 01:56 PM
I'm not quite sure I understand. Using one of my questionnaires, I query:
{
"Value": "?$orderby=Name&$filter=Name eq 'Attach Documentation'"
}
This gives me "IsQuestion": false; as one of the properties. However, then I try
{
"Value": "?$orderby=Name&$filter=Name eq 'Attach Documentation'&$select=Name,IsQuestion"
}
and it says that it could not find a property name 'IsQuestion'.
Are you saying the only way to just pull the question fields is programmatically? In other words, get the results of the query on all fields in the module and then do some sort of 'IsQuestion eq True' filter on that?
2020-08-31 02:13 PM
Yes, the recommendation is to pull all field definitions for the application/level and filter the results.
A defect was logged as ARCHER-66403 and was closed as functioning as designed. Then a defect logged as ARCHER-67378 updated the documentation starting in 6.8. If you open the Archer Help, search for "Metadata" and scroll down to very bottom to see a note.
Metadata
Note: The following properties are allowed with the $filter, $select, and the $orderby actions in the OData query on the field definition resources available in the table above:
- Id
- LevelId
- Type
- Name
- Alias
- IsActive
- Guid
- ASOStatus
- SystemType
- IsPrivate
- IsContentReadOnly
- EsFieldMappingId
- UpdateInformation
- FieldMap
2020-08-31 02:45 PM
That really helps. Of course, it doesn't help that our Jurassic Archer (6.4 SP1 P1) doesn't have that extra note.