Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..

cancel
Showing results for 
Search instead for 
Did you mean: 
No ratings
KB-Sync1
Archer Employee
Archer Employee

Article Number

000033884


Applies To


Product(s): Archer
Version(s): All Versions
Primary Deployment: On Premises/AWS Hosted/AWS SaaS

Description


How to find field information for a given Field Id using REST API instead of a SQL query?

  • The Archer log file contains exception messages, however, it only provides the Field Id.  
  • The following is a sample exception message from the Archer.ArcherTech.JobFramework.Job.yyyymmdd.xml log file for a bad calculated field:
Attempting to calculate field 3044 of content 338304 resulted in: System.ArgumentException: Value is not a valid number: B2.....

 


Resolution


  1. Take note of the Field Id.
  2. From a browser, login to Archer.
  3. In the URL, delete everything after the Base URL and append the following after replacing *FieldId* with the Field Id from step 1.
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":[]}

NoteIf 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>

 

  1. 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":[]}

     

  2. 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":[]}

     

  1. 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":[]}

     


Version history
Last update:
‎2024-09-21 07:12 AM
Updated by: