A Singapore Government Agency Website

Using Objects

Objects let you extract complex, nested data from documents β€” such as tables, repeating groups, and multi-level structures.

When Do You Need Objects?

Use Objects when your document contains repeating groups of related fields. For example:

Document The repeating group Fields within each group
Timesheet Each row entry Day, Date, Description, Time In, Time Out, Hours
Annual Report Each board director Name, Designation, Years of Experience, Profile
Corporate Phone Bill Each phone number Number, Data Usage
Report Card Each subject Subject Name, Score, Grade
Resume Each work experience Company Name, Job Title, Start Date, End Date
Invoice Each line item Item Name, Quantity, Unit Price

If you tried to use separate List fields for each column (e.g., one List for β€œall names” and another for β€œall phone numbers”), the lists might not match up β€” some entries could be missing a value, breaking the association between related data. Objects solve this by keeping related fields grouped together.

What Is an Object?

An Object is a logical group of related fields. Think of it as a row in a table, or a record in a database.

For example, a Person Object might contain:

  • Person Name
  • Person Age
  • Person Education

A Timesheet Entry Object might contain:

  • Day
  • Date
  • Time In
  • Time Out

You can define anything as an Object, and include any number of fields within it, as long as the fields are logically related.

How to Set Up Objects in the Web Portal

The pattern is always: List β†’ Object β†’ Object Fields

Step-by-Step

  1. Click β€œAdd Prompt”
  2. Set the Data Type to List
  3. Write a prompt describing what the list contains (e.g., β€œTimesheet entries for each row”)
  4. In the Nested fields section that appears, click β€œ+ Add Field”
  5. Set this nested field’s Type to Object and give it a label (e.g., β€œTimesheet Entry”)
  6. Write a prompt for the object (e.g., β€œEach timesheet entry row”)
  7. In the Object fields section that appears, click β€œ+ Add Field” to add each sub-field
  8. Define each sub-field with a label, type (usually Text, Number, or Date), and prompt

Example 1: Timesheet

Goal: Extract all rows from a daily timesheet log.

Structure:

Timesheet List (List)
  └─ Timesheet Entry (Object)
       β”œβ”€ Day (Text) β€” "Extract the day of the timesheet"
       β”œβ”€ Date (Text) β€” "Extract the date of the timesheet"
       β”œβ”€ Description (Text) β€” "Extract the work description"
       β”œβ”€ Time In (Text) β€” "Extract the clock-in time"
       β”œβ”€ Time Out (Text) β€” "Extract the clock-out time"
       └─ Hours (Number) β€” "Extract the number of hours worked"

Portal setup:

Level Data Label Type Prompt
Top Timesheet List List Timesheet List
Nested Timesheet Entry Object Timesheet Entry
Object field Day Text Extract the day of the timesheet
Object field Date Text Extract the date of the timesheet
Object field Description Text Extract the work description
Object field Time In Text Extract the clock-in time
Object field Time Out Text Extract the clock-out time
Object field Hours Number Extract the number of hours worked

Example 2: Annual Report β€” Board of Directors

Goal: Extract details of every board director from an annual report.

Structure:

List of Directors (List)
  └─ Director Object (Object)
       β”œβ”€ Director Name (Text) β€” "Return the director name. For example, Mr Tan Ah Kow"
       β”œβ”€ Years of Experience (Text) β€” "Return the stated years of experience. For example, 5."
       └─ Profile (Text) β€” "Return a 100 word summary of the Director's Profile"

Example 3: Corporate Phone Bill

Goal: Extract each mobile number and its associated data usage.

Structure:

Number Data Pairs (List)
  └─ Number_Data (Object)
       β”œβ”€ Phone Number (Text) β€” "Return the phone number"
       └─ Local Data Usage (Text) β€” "Return the local data usage, e.g. 5kb. If none, return 0."

Combining Objects with Normal Fields

You don’t have to choose between simple fields and Objects β€” use both in the same extraction.

Example: Full Timesheet Extraction

A timesheet has simple fields (Name, Department) at the top and repeating rows in the table. Extract everything together:

Name (Text) β€” "Extract the Name on the TimeSheet"
Department (Text) β€” "Extract the Department on the TimeSheet"
Timesheet List (List)
  └─ Timesheet Entry (Object)
       β”œβ”€ Day (Text)
       β”œβ”€ Date (Text)
       β”œβ”€ Time In (Text)
       └─ Time Out (Text)

In the Excel export, the simple fields (Name, Department) appear as regular columns. The List of Objects gets expanded so each entry appears on its own row.

More Examples

Report Card

Name (Text)
Student ID (Text)
Attendance Rate (Number)
Subject List (List)
  └─ Subject (Object)
       β”œβ”€ Subject Name (Text)
       β”œβ”€ Score (Number)
       └─ Grade (Text)

Resume

Executive Summary (Text)
Skills (List)
Resume Summary (Text)
Experiences List (List)
  └─ Experience (Object)
       β”œβ”€ Company Name (Text)
       β”œβ”€ Job Title (Text)
       β”œβ”€ Start Date (Date)
       └─ End Date (Date)

Tips

  • Identify what’s repeating β€” If you see rows in a table, entries in a list, or profiles in a section, that’s your Object
  • Keep Object fields focused β€” Only include fields that are logically part of the same group
  • Use descriptive prompts β€” Even within Objects, give examples and context in your field prompts
  • Test with a single file first β€” Verify the structure is correct before processing in bulk
Chat with me!
Bot Launcher