> For the complete documentation index, see [llms.txt](https://docs.agilecase.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.agilecase.com/developer-documentation/case-scripting/on-load-scripts/add-custom-field-data-to-main-case-panel.md).

# Add Custom Field Data To Main Case Panel

This example demonstrates a script that adds data from one of your custom fields to the main case panel.

You can copy this script into your own system, but you will need to edit it to select your own custom fields.

This script is useful if you want to provide users with immediate access to custom field content that would usually be hidden under several layers of tabs.

## Script

```javascript
//The first row specifies the field you wish to pick out. You can do this by changing "Customer Rating" to your own field.
$.get('/api/case/' + caseid + '/data?getValues=Custom.CustomerRating', function( data ) {
	
	var name = data.data.customFields[0].name;
	var value = data.data.customFields[0].value;

	$('.well table tbody').append('<tr><th>' + name + '</th><td>' + value + '</td><th></th><td></td></tr>')
});
```

The script above picks out a custom field you have specified and displays it on the main case panel.

## Before

<figure><img src="https://2254578867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlbQndiLuyFlBYZOTuVGa%2Fuploads%2Fgit-blob-c9fc21c6e0982181d944e86c16973a59c89b5d1f%2Fbeforescripting.png?alt=media" alt=""><figcaption></figcaption></figure>

Before the script is applied to the case type, the main case page will look like this.

## After

<figure><img src="https://2254578867-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlbQndiLuyFlBYZOTuVGa%2Fuploads%2Fgit-blob-e6d5f9b89236aad41c094b4b1ab82147317f153c%2Fafterscripting.png?alt=media" alt=""><figcaption></figcaption></figure>

After the script has been applied, the "Customer Rating" field and its value are present on the main case page.
