API List Block

This block works on multiple modules and will show the results of an API call in a temporary listview. This allows for the display of data in a Profile without needing to store the data in LegalServer. This is available on multiple modules and on both Profiles and Forms. Values from within the associated module can be used as API parameters in the API call.

This block was built on the Generic Outgoing API Block and shares may similar configuration options.

Listview Notes

You cannot sort the listview using the column headers.

You can still export the Excel or CSV files.

It will default to 20 records and allow paging for multiple pages of data.

Configuration

The columns are identified by selecting the array of data and for each key/value pair, using the capitalized key with underscores being converted to spaces. So if an API returned a key/value pair of "assigned_attorney": "LegalServer Staff" , the column would be Assigned Attorney and the value in the column would be LegalServer Staff .

This block is available on multiple modules and can use fields from that module as query parameters.

JQ Filter for Display

The first step in setting up the jq filter is to isolate the array of data rows. LegalServer utilizes jq 1.5 and we recommend testing with a tool like jqplay.org.

Do not put data with Personally Identifiable Information on jqplay as you do not have control over that server. You can run it in a docker instance if you have concerns or cannot anonymize the data.

If the API returns something like LegalServer's matter APIs, that has the lists to display in an array named data :

{

"page_number": 1,

"page_size": 100,

"total_number_of_pages": 1,

"total_records": 2,

"data": [

{

"case_number": "22-0000093",

...

},

{

"case_number": "23-0000123",

...

}

]

}

With that sort of response, you'll want to start with:

.data[] |

The . indicates to return the data completely, specifying data returns the data key, and the brackets grab all of the array values listed. The pipe - | - is then used to pass the data along to another function in JQ.

The end of the filter is going to be a set of curly brackets and the names of all the keys of data you want to see in the listview. Without this, it will show every key instead of just the ones you want it to.

Rename a Key

If you want to rename a key, you can do that by putting that in between two pipes:

.data[] | .["open_date"] = .date_opened.raw_value | {"matter_uuid", "case_number", "client_full_name", "case_disposition", "open_date" }

The above example creates a new key in the response called open_date which is set to a value from the date_opened object that already existed. This can be used to rename keys to more appropriate column names. It can also be used to promote a sub-object (like raw_value ), to a top level field for the data display.

Sorting via JQ

This appears to currently throw an error and will not work.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us