Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
000033884
How to find field information for a given Field Id using REST API instead of a SQL query?
Attempting to calculate field 3044 of content 338304 resulted in: System.ArgumentException: Value is not a valid number: B2.....
api/core/system/fielddefinition/*FieldId*?$select=Id,Name,Alias,LevelId
Note: If using Internet Explorer, you will be prompted to save/open a file. Open the file in Notepad or another text editor. The data is in JSON format like the following:
{"Links":[],"RequestedObject":{"Id":3044,"Name":"Count of Objectives","Alias":"Count_of_Objectives","LevelId":5},"IsSuccessful":true,"ValidationMessages":[]}
Note: If using Chrome, the data is displayed in XML format on the web page like the following:
<WebApiRequestResultOfArrayOfKeyValueOfstringanyTypeuHEDJ7Dj xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ArcherTech.Common.Domain.Result"> <ValidationMessages xmlns:d2p1="http://schemas.datacontract.org/2004/07/ArcherTech.Common.Validation" xmlns="http://schemas.datacontract.org/2004/07/ArcherTech.Common.Domain" /> <IsSuccessful xmlns="http://schemas.datacontract.org/2004/07/ArcherTech.Common.Domain">true</IsSuccessful> <RequestedObject xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/ArcherTech.Common.Domain"> <d2p1:KeyValueOfstringanyType> <d2p1:Key>Id</d2p1:Key> <d2p1:Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int">3044</d2p1:Value> </d2p1:KeyValueOfstringanyType> <d2p1:KeyValueOfstringanyType> <d2p1:Key>Name</d2p1:Key> <d2p1:Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Count of Objectives</d2p1:Value> </d2p1:KeyValueOfstringanyType> <d2p1:KeyValueOfstringanyType> <d2p1:Key>Alias</d2p1:Key> <d2p1:Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Count_of_Objectives</d2p1:Value> </d2p1:KeyValueOfstringanyType> <d2p1:KeyValueOfstringanyType> <d2p1:Key>LevelId</d2p1:Key> <d2p1:Value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int">5</d2p1:Value> </d2p1:KeyValueOfstringanyType> </RequestedObject> <Links /> </WebApiRequestResultOfArrayOfKeyValueOfstringanyTypeuHEDJ7Dj>
To get the Level information, delete everything after the Base URL and append the following after replacing *LevelId* with the Level Id from step 3:
api/core/system/level/*LevelId*?$select=Id,Name,ModuleId
Sample results with Level information:
{"Links":[],"RequestedObject":{"Id":5,"Name":"Section","ModuleId":65},"IsSuccessful":true,"ValidationMessages":[]}
To get the Module information, delete everything after the Base URL and append the following after replacing *ModuleId* with the Module Id from step 4:
api/core/system/application/*ModuleId*?$select=Id,Name,Alias
Sample results with Module information:
{"Links":[],"RequestedObject":{"Id":65,"Name":"Policies","Alias":"Policies"},"IsSuccessful":true,"ValidationMessages":[]}
If step 5 returns "The resource cannot be found" message, the Module may be a Questionnaire which requires a different URL. Delete everything after the Base URL and append the following after replacing *ModuleId* with the Module Id from step 4:
api/core/system/questionnaire/*ModuleId*?$select=Id,Name,Alias
Sample results for a Questionnaire.
{"Links":[],"RequestedObject":{"Id":325,"Name":"Facility Assessment","Alias":"Facility_Assessment"},"IsSuccessful":true,"ValidationMessages":[]}