Skip to main content
Question

How to get the details of the selected record with an API call?

  • 1 July 2024
  • 3 replies
  • 71 views

Hello,

We have created a custom upload screen for the universal GUI. We have done this by firing the indicium API when we want to upload a file. (‘/indicium_ont/sf/appId/tableName’).

We want to use this screen in multiple different places. The place where this document will be uploaded is important, because it will be linked to the currently actived record, of which we are viewing the details.

I was wondering if there is a similar API call where we can GET the details of the record that is currently being displayed in the details tab. 

Thanks in advance!

3 replies

Userlevel 6
Badge +4

Hello @Niels Koop,

There are two ways to do this.

The first way allows you to retrieve the parent set or record and the related detail set per parent record in a single request. This is done by the OData $expand operation, as explained here. The result of this API call will be a hierarchical set of JSON data where each parent record will have a property for the detail reference that contains an array of every related detail record for that parent record.

Examples

  • /table?$expand=detail_ref_table_detail
  • /table(key)?$expand=detail_ref_table_detail

The second way is to retrieve just the set of detail records for a given parent record without including the parent record itself in the response. This method does not use the OData $expand operation and only allows you to retrieve the detail set of a single parent record. This method will not yield a hierarchical set of JSON data, but rather the same structure as when simply requesting a table like /tableName. It can be achieved as shown below.

Examples

  • /table(key)/detail_ref_table_detail

I hope this helps.

Userlevel 1
Badge +2

Hello @Niels Koop,

There are two ways to do this.

The first way allows you to retrieve the parent set or record and the related detail set per parent record in a single request. This is done by the OData $expand operation, as explained here. The result of this API call will be a hierarchical set of JSON data where each parent record will have a property for the detail reference that contains an array of every related detail record for that parent record.

Examples

  • /table?$expand=detail_ref_table_detail
  • /table(key)?$expand=detail_ref_table_detail

The second way is to retrieve just the set of detail records for a given parent record without including the parent record itself in the response. This method does not use the OData $expand operation and only allows you to retrieve the detail set of a single parent record. This method will not yield a hierarchical set of JSON data, but rather the same structure as when simply requesting a table like /tableName. It can be achieved as shown below.

Examples

  • /table(key)/detail_ref_table_detail

I hope this helps.

Hi Vincent, thank you for this answer. I am struggling with a preceding part of this work, because I cannot find a way to display my view in the details of my selected row.

I have created a view where I have a DnD area where poeple can upload files, which is 1 part of the screen, and a list + preview component which is another part of the screen. These are combined in a view so they are shown together.

How can I get this view to be displayed with the correct documents showing for a selected row?

Userlevel 6
Badge +4

Hello @Niels Koop,

Sorry for the late reply, do you still need help with this?

Reply