Question

Custom Column filter not works

  • 6 December 2023
  • 2 replies
  • 51 views

Hello, i am using sysaid rest api and i tried to fetch a service records with a custom column, i used this example endpoint: https://[my_site]/api/v1/sr/search?query=*&CustomColumn9sr=3469262019072400036,
and this endpoint return all of service records, the filter not working with custom columns but work with native keys, like status, department…, what can i do to works a custom column search?

 


2 replies

Userlevel 2
Badge +1

Hi @ghoeugenio ,

There are different lists that are fetched by an entity type, for example the ‘Custom Column’, if you want to get all available lists in the Service Request form you will have to send the following api call: /list?entity=sr.


The Relational Lists must have a GET format like: GET/relational_list/{id}?entity={entity}&offset={offset}&limit={limit}&id={idField}

Becasue Relational lists are a special custom column type that represents a list of items from a referenced entity they support displaying data from the following entities: Assets, Companies, CI, Groups, Software Products and Users.  

The field entity is optional. The Default is sr and the supported entities are: “sr”, “ci” and “action_item”
This is a sample JSON file that returns values for relational_list/CustomColumn188srSubTab?entity=action_item

{

    "id": "CustomColumn188srSubTab",

    "caption": "rellist",

    "values": [ {"id": "10004517", "caption": "John Doe"},

                {"id": "10000010", "caption": "a@b.com"},

                {"id": "10003446", "caption": "Federico Williams"},

                {"id": "10004350", "caption": "Felecia Garcia"}]

}

 

For more information about the Rest API you can refer to THIS documentation.
If you need more help, have further questions, or just want to chat about this topic, please don't hesitate to reach out. 

Hi @ghoeugenio ,

There are different lists that are fetched by an entity type, for example the ‘Custom Column’, if you want to get all available lists in the Service Request form you will have to send the following api call: /list?entity=sr.


The Relational Lists must have a GET format like: GET/relational_list/{id}?entity={entity}&offset={offset}&limit={limit}&id={idField}

Becasue Relational lists are a special custom column type that represents a list of items from a referenced entity they support displaying data from the following entities: Assets, Companies, CI, Groups, Software Products and Users.  

The field entity is optional. The Default is sr and the supported entities are: “sr”, “ci” and “action_item”
This is a sample JSON file that returns values for relational_list/CustomColumn188srSubTab?entity=action_item

{     "id": "CustomColumn188srSubTab",     "caption": "rellist",     "values": [ {"id": "10004517", "caption": "John Doe"},                 {"id": "10000010", "caption": "a@b.com"},                 {"id": "10003446", "caption": "Federico Williams"},                 {"id": "10004350", "caption": "Felecia Garcia"}] }

 

For more information about the Rest API you can refer to THIS documentation.
If you need more help, have further questions, or just want to chat about this topic, please don't hesitate to reach out. 

Hello @dragos.baciu , thanks by your support, but doesnt work yet, i need to get a service record by customColumn9sr(previously created), this custom column are unique, will return just one item. So, how can i do this? i try to use /api/v1/sr?customColumn9sr=123456789&view=SysAidMobile and not works

Reply