These objects hold the records people create in Explorer, Shift Log and Case Management: deferment cases, equipment issues, shift summaries, downtime windows and log sheet readings. They also hold the forms, picklists and audit trail behind them.
Objects
Objects whose names start with Sapi are read through SAPI, Explorer's own server API, the same way Explorer itself reads them. They return exactly what Explorer shows, including live values for data-entry fields.
| Object | What it holds | Kind |
|---|---|---|
| SapiCases | Cases: deferment and loss events, investigations | Live |
| SapiIssues | Equipment issues and defects | Live |
| SapiSummaries | Shift handovers, daily production summaries | Live |
| SapiTimeWindows | Downtime and shut-in windows covering one or more assets | Live |
| SapiComments | Comments: Id and Text | Live |
| EntryRecords | Every entry, for counting and trending | Database-backed |
| EntryForms | Links each entry to each of its forms | Database-backed |
| EntryFieldForms | Pairs each field value with each form of its entry | Database-backed |
| Forms | Form definitions | Database-backed |
| FormSchemas | The schema behind each form | Database-backed |
| FormFields | Field definitions | Database-backed |
| NamedLists | Picklists and their items | Database-backed |
| EntryAuditLogs | Every change to every entry field | Database-backed |
| EntryChanges | Every change to every entry field, once per form of the entry | Database-backed |
| EntryAttachments | Files attached to entries | Database-backed |
| LogSheets | Log sheet definitions and columns | Live |
| LogSheetRows | Log sheet readings, one row per sheet and time | Live |
SapiCases, SapiIssues, SapiSummaries and SapiTimeWindows
Each site configures its own forms, so the fields on these objects differ between installations. OI OData flattens every form field into its own column, named after the field's Name (as in FormFields), not its display name.
Fixed fields, on every row:
| Field | Notes |
|---|---|
| Id | Entry ID |
| State | Draft, Pending or Submitted (not on SapiTimeWindows) |
| AttachmentCount | Number of attached files |
| EntityName | The asset the entry is about |
| Entity | The asset, with its details |
| Entities | SapiTimeWindows only: every asset the window covers |
| FormNames | The forms the entry belongs to |
| Attachments | The entry's attached files. Only filled in with $expand=Attachments. |
| form fields | One column per form field, such as StartTime, EndTime, DeferredOil, Reason |
Without $orderby, entries come back newest first.
Form field types. Each form field keeps its data type:
| Field data type | Returned as | Example |
|---|---|---|
| Integer | Whole number | "Starts": 3 |
| Decimal, Calculation | Number | "DeferredOil": 1250.5 |
| Boolean | true or false | "ShutIn": true |
| Date and time | Date and time (UTC) | "StartTime": "2026-10-01T06:00:00Z" |
| User, Entry, Link, Procedure, Reference | The item's number | "Approver": 12 |
| Display, Workbook | The item's ID | "Workbook": "6f1c…" |
| Data entry | The type its value is saved as | "THPatShutIn": 1450.5 |
| Text, picklist, asset, tag, role, area and others | Text | "Severity": "High" |
| Any field that holds several values | Text, the values separated by , | "Equipment": "Pump, Valve" |
Compare numbers, Booleans and dates without quotes: DeferredOil gt 1000, ShutIn eq true, StartTime ge 2026-10-01T00:00:00Z. Sorting and grouping use the type too.
Cases on Alpha wells:
SapiCases?$filter=startswith(EntityName,'WELL-A')&$select=Id,EntityName,StartTime,EndTime,Reason&$orderby=EntityName
Submitted cases only:
SapiCases?$filter=State eq P2.Server.DataDictionary.EntryState'Submitted'&$select=Id,EntityName,Reason
Deferment log for a chosen well:
SapiCases?$filter=EntityName eq ODataParam(well,string)&$select=Id,State,StartTime,EndTime,Reason
Issues on a well, with the asset's location:
SapiIssues?$filter=EntityName eq 'WELL-A12'&$compute=Entity/Latitude as Latitude,Entity/Longitude as Longitude&$select=Id,EntityName,Latitude,Longitude
Time windows that cover a compressor:
SapiTimeWindows?$filter=Entities/any(e: e/Name eq 'K-201')&$select=Id,StartTime,EndTime
Live values for data-entry fields
A data-entry field is a form field whose value comes from process data instead of being typed in. For example, a THPatShutIn field on a Well Downtime form reads tubing head pressure at the moment the well was shut in.
For these fields, OI OData reads the source system (PI, IP.21 and so on) when the query runs and returns that live value. It only falls back to the value saved on the entry if the live read fails.
Which fields are read live
A field is read live only if all of these are true:
- Its type is Data Entry.
- Its source is a Tag or an Attribute.
- The entry has that field.
- The query asks for it. See Choosing which fields are read.
The source settings come from the field's Default Global Definition. If a form overrides the source tag or time for its own copy of the field, OI OData uses the global default instead.
What is read, and when
| Field source | What is read |
|---|---|
| Tag | The field's configured source tag |
| Attribute | The configured attribute on the entry's asset, such as the Tubing Head Pressure "Actual" value of WELL-A12 |
The Attribute source makes one form work for every asset. The same THPatShutIn field reads WELL-A12's tag on an A12 entry and WELL-B07's tag on a B07 entry.
| Source time setting | Read time | Fallback |
|---|---|---|
| Now (or not set) | The moment the query runs | |
| Property | The value of a named date/time field on the entry, such as ShutInTime | None. If that field is empty, the saved value is used. |
| Offset from start | The entry's StartTime plus the offset | CreatedDate, if the entry has no StartTime |
| Offset from end | The entry's EndTime minus the offset | CreatedDate, if the entry has no EndTime |
Difference from Explorer: in Explorer, offsets can be anchored on the shift or reporting period. OI OData has no shift context, so it always anchors offsets on the entry's own StartTime or EndTime, or CreatedDate.
When the saved value is used instead
The query never fails because of a data-entry field. If the live read can't produce a value, the field shows what was saved on the entry. This happens when no source is configured, the entry has no asset, the source-time field is empty, the historian can't be reached or returns an error, or there's no data at that time.
Choosing which fields are read
- Without $select, every live field on each entry is read.
- With $select, only the live fields named in $select, $filter, $orderby, $apply or $compute are read. $select=* works like no $select.
- Usually only the entries in the response are read. If $filter and $orderby only use saved fields such as Id, State or EntityName, $top=50 reads 50 entries.
- Every fetched entry is read, up to 5,000, if $filter or $orderby uses a live field, or the query uses $apply or $compute.
Each live read is a historian request, so select only the live fields you need, and filter on saved fields:
SapiCases?$filter=startswith(EntityName,'WELL-A')&$select=Id,EntityName,THPatShutIn,CHPatShutIn&$top=200
What this means for your pages
- The value may differ from what Explorer shows on the entry, if historian data was corrected after the entry was saved.
- "Now"-timed fields change every time the dataset refreshes. They show current conditions, not conditions when the entry was logged.
- To see what was actually saved, use EntryAuditLogs. It holds the saved value of every field change and is never read live.
Counting and trending entries: EntryRecords
SapiCases, SapiIssues, SapiSummaries and SapiTimeWindows are evaluated over at most 5,000 entries. For counts and trends, use the database-backed objects:
| Object | Fields and navigations |
|---|---|
| EntryRecords | Id, CreatedDate, State, IsDeleted, LastModified, CreatedBy, EntryForms, EntryFields, Attachments, AuditLogs. EntryFields gives each field's definition, lock state, LastModified and Values. AuditLogs is the entry's audit trail. |
| EntryForms | FormSchemaId, LastModified, Entry, FormSchema, CreatedBy. One row per entry per form. |
| EntryFieldForms | EntryField, EntryForm. Pairs each entry field with each form of its entry, as in EntryField/FormField/Name and EntryForm/FormSchema/Name. |
Entries per day for a month:
EntryRecords?$apply=filter(CreatedDate ge ODataParam(startTime,datetime) and CreatedDate lt ODataParam(endTime,datetime))/compute(year(CreatedDate) as Year,month(CreatedDate) as Month,day(CreatedDate) as Day)/groupby((Year,Month,Day),aggregate($count as Entries))&$orderby=Year,Month,Day
Entries per form per week, for a logging-compliance chart:
EntryForms?$apply=filter(Entry/CreatedDate ge OI.monthsago(3))/compute(OI.startofweek(Entry/CreatedDate) as Week,FormSchema/Name as Form)/groupby((Week,Form),aggregate($count as Entries))&$orderby=Week,Form
Entries per form and author this month:
EntryForms?$apply=filter(Entry/CreatedDate ge OI.startofmonth(now()))/compute(FormSchema/Name as Form,CreatedBy/DisplayName as Author)/groupby((Form,Author),aggregate($count as Entries))&$orderby=Entries desc
Field values on EntryRecords
An entry's field values are in EntryRecords/EntryFields/Values, one row per value, so a field that holds several values has several. Each value is in the column for its field's data type:
| Field | Notes |
|---|---|
| Snapshot | The value as Explorer displays it, whatever its type |
| ValueString, ValueText | Text values |
| ValueInteger | Whole numbers |
| ValueDecimal | Decimal and calculated values |
| ValueBoolean | Yes/no values |
| ValueDateTimeUtc | Dates and times |
| ValueUser, ValueEntity, ValueTag, ValueNamedListItem, ValuePage, ValueWorkbook | The item a value refers to |
| LastModified | When the value was saved |
Every value of entry 1234, by field:
EntryRecords?$filter=Id eq 1234&$select=Id&$expand=EntryFields($select=Id;$expand=FormField($select=Name),Values($select=Snapshot,ValueDecimal,ValueDateTimeUtc))
- Values are only available through their entry, so they follow the entry's security: Draft and Pending entries' values are as private as the entries.
- An entry's fields are limited, as in Explorer, to the fields on its forms that you have access to, plus its built-in fields such as CreatedDate and Workbook. Entries admins see every field. The same applies to SapiCases, SapiIssues, SapiSummaries and SapiTimeWindows.
- A secured field's value is left out when you can't see the item it refers to, such as an asset or a workbook.
- The audit trail (EntryAuditLogs, EntryChanges) isn't limited by field: it lists every change to an entry you can see.
- Values is a collection, so read it in a browser or Power BI rather than in a dataset. For a dataset, use the field's column on SapiCases, SapiIssues, SapiSummaries or SapiTimeWindows.
Forms, fields and named lists
| Object | Fields and navigations |
|---|---|
| Forms | Id, Name, LastModified, FormSchemaId, FormSchema |
| FormSchemas | Id, Name, ShortName, EntryType (a number: 1 Case, 3 General, 5 Log), IsSystem, WriteToExternalReporting, LastModified, TraitGroups |
| FormFields | Name, DisplayName, Description, DataType, IsSystem, LastModified, NamedList |
| NamedLists | Name, IsSystem, LastModified, Items (each with a Value) |
A picklist's items. Items is a collection, so read the picklist in a browser or Power BI rather than in a dataset:
NamedLists?$filter=Name eq 'Deferment.Reasons'&$expand=Items($select=Value)
Forms changed recently:
Forms?$filter=LastModified ge OI.daysago(30)&$select=Name,LastModified&$orderby=LastModified desc
Number of fields per naming family:
FormFields?$apply=filter(IsSystem eq false)/compute(OI.nameprefix(Name) as Family)/groupby((Family),aggregate($count as Fields))&$orderby=Fields desc
Fields that use a picklist:
FormFields?$filter=NamedList ne null&$compute=NamedList/Name as PickList&$select=Name,DisplayName,PickList&$orderby=PickList
Audit trail
EntryAuditLogs records every change to every entry field.
| Field | Notes |
|---|---|
| Id | Audit row ID |
| Entry | The entry that changed |
| User | Who changed it |
| Timestamp | When |
| LastModified | When the audit row was written |
| OperationType | None, Insert, Update or Delete |
| EntryEventType | The kind of entry event |
| FieldName | The field that changed |
| DataType | The field's data type |
| NewValue | The value saved, as text |
Change history of one field on one entry:
EntryAuditLogs?$filter=Entry/Id eq ODataParam(entryId,integer) and FieldName eq 'Status'&$compute=User/DisplayName as ChangedBy&$select=Timestamp,ChangedBy,NewValue&$orderby=Timestamp asc
Changes per user in the last week:
EntryAuditLogs?$apply=filter(Timestamp ge OI.daysago(7))/compute(User/DisplayName as ChangedBy)/groupby((ChangedBy),aggregate($count as Changes,Timestamp with max as Latest))&$orderby=Changes desc
Changes per save: EntryChanges
EntryChanges has the same changes, with the details a "who changed what" report needs as plain fields. It repeats each change once for every form of its entry.
| Field | Notes |
|---|---|
| AuditLogId, EntryFormId | The key: the audit row and the entry's form link |
| Entry, User | The entry, and who changed it |
| LastModified | When the audit row was written |
| ActionTime | LastModified without fractions of a second. All the changes from one save share it. |
| UserName | Who changed it, by display name |
| OpType | Insert or Update |
| FieldName, NewValue | The field and the value saved |
| Change | FieldName: NewValue as one text |
| WorkbookValue | NewValue when the field is Workbook, otherwise empty |
| Form | The form |
Changes a user made during a period, one row per entry and save, with every changed field listed using OI.stringagg:
EntryChanges?$apply=filter(LastModified ge ODataParam(startTime,datetime) and LastModified le ODataParam(endTime,datetime) and contains(UserName,ODataParam(userName,string)))/groupby((Entry/Id,ActionTime),aggregate(UserName with max as UserName,OpType with max as OpType,WorkbookValue with max as Workbook,Form with max as Form,Change with OI.stringagg as Changes))&$orderby=Entry/Id desc,ActionTime desc
For an entry on several forms, Form shows one of them and each change appears once per form in Changes. Grouping by Entry/Id returns Entry as a nested object, which a dataset can't read, so run this one in a browser or Power BI.
Attachments
EntryAttachments lists the files attached to entries, such as photos, inspection reports and permits.
| Field | Notes |
|---|---|
| Id, Entry | The attachment, and the entry it belongs to |
| Name, Description | As entered by the user who attached the file |
| FileContentType, FileExtension | Such as application/pdf and pdf |
| FileSize | In bytes |
| AddedDate, AddedBy | When, and by whom |
| LastModified |
Every PDF attached in a period, with who added it:
EntryAttachments?$filter=FileExtension eq 'pdf' and AddedDate ge ODataParam(startTime,datetime) and AddedDate lt ODataParam(endTime,datetime)&$compute=Entry/Id as EntryId,AddedBy/DisplayName as AddedByName&$select=Name,FileSize,EntryId,AddedByName
The file itself is at EntryAttachments(<Id>)/$value. A dataset can't show a file, but you can open this URL in a browser, or link to it from a page:
https://<your-oi-server>/<service-root>/odata/EntryAttachments(77)/$value
- Only PNG, JPEG, GIF, BMP and WebP images, PDFs and plain text open in the browser. Everything else, including SVG and HTML, downloads.
- You only see attachments on entries you can see.
- To count attachments, AttachmentCount on the entry is cheaper.
Log sheets
A log sheet is a grid of readings that operators fill in by time, such as hourly flow, pressure and pump starts on a shift log. Each sheet defines its own columns, so OI OData returns each reading time as one row with one column per log sheet column:
| LogSheetName | Timestamp | Flow | Pressure | Starts |
|---|---|---|---|---|
| Shift A | 2026-10-01T06:00:00Z | 12.5 | 3.2 | 2 |
| Shift A | 2026-10-01T07:00:00Z | 12.8 | 3.1 | 2 |
| Object | What it holds | Fields |
|---|---|---|
| LogSheets | One row per sheet | Name, Description, LastModified, Columns, Rows. Columns and Rows come back only with $expand, and $expand=Rows returns at most 5,000 rows in all. |
| LogSheetRows | One row per sheet and reading time | LogSheetName, Timestamp, then one column per log sheet column |
Column values
- Values are numbers, not text. Integer columns return whole numbers, decimal columns return decimals.
- The column name is the log sheet column's name, with spaces and punctuation turned into _. If two columns share a name in different column groups, the one created later is named _2, the next _3, and so on, such as Flow_2. Reordering or adding columns never renames one.
- A reading that wasn't entered is left out of the row. It never matches gt, lt or eq, and always matches ne.
- Compare readings with numbers or with other columns: Flow gt 100, Flow gt Flow_2.
One day of readings from a chosen sheet:
LogSheetRows?$filter=LogSheetName eq ODataParam(sheet,string) and Timestamp ge ODataParam(startTime,datetime) and Timestamp lt ODataParam(endTime,datetime)&$orderby=Timestamp
Readings over a limit:
LogSheetRows?$filter=LogSheetName eq 'Shift A' and Timestamp ge 2026-10-01T00:00:00Z and Flow gt 100&$select=Timestamp,Flow
To see a sheet's column definitions, including limits, data types and source tags, open this in a browser:
LogSheets?$filter=Name eq 'Shift A'&$select=Name&$expand=Columns
Things to know about log sheets
- Always filter LogSheetRows by LogSheetName and Timestamp first, joined with and. Those filters run in the database. Filters on reading columns run afterwards, over at most 5,000 rows.
- Different sheets have different columns. In a dataset, filter to one sheet, or sheets with the same columns, so every row has the same shape.
- Deleted log sheets never appear, and neither do their readings.
- LogSheetRows can't be used in Union or $crossjoin.
Functions
This prebuilt function returns a report that standard OData can't express: it picks the latest entry in each group. Parameters go inside the brackets. Text values use single quotes. You can use ODataParam inside the brackets.
| Function | Returns | Columns |
|---|---|---|
| LastEntryPerWorkbook(user='..') | The user's most recent entry per workbook and form in the last 7 days, newest first. user is the exact username of whoever added the entry to the form. NewValues includes changes by any user, and entries with no recorded changes are left out. | CreatedDate, Workbook, Form, NewValues (each field as Field > value, separated by @) |
Function results come in a fixed shape. $filter, $orderby, $select and $top are ignored.
A supervisor's latest entry per workbook this week:
LastEntryPerWorkbook(user=ODataParam(user,string))
To pick the latest entries yourself, for example in Power BI, read the same user's recent entries with their audit trail and keep the newest per workbook and form:
EntryForms?$filter=CreatedBy/Username eq ODataParam(user,string) and Entry/CreatedDate gt OI.daysago(7)&$expand=Entry($select=CreatedDate;$expand=AuditLogs($select=FieldName,NewValue;$orderby=FieldName)),FormSchema($select=Name)&$orderby=Entry/CreatedDate desc
Things to know
- Form field values keep their type. See Form field types. A number compared with a quoted value, as in DeferredOil eq '1250.5', is compared as text, so write numbers without quotes.
- Field names with spaces or punctuation get _ instead, so they work in $filter and $select: Deferred Oil is Deferred_Oil. A field named like one of the object's own properties, such as State, is State_Field.
- Draft and Pending entries are private. You see only your own unless you have Admin rights on the Entries module. Their attachments, audit rows, form links and EntryChanges rows are hidden too, and EntryChanges also leaves out forms you can't see.
- Log sheets aren't secured. Every signed-in user sees every log sheet.
- Entries are read-only through OI OData. Create and edit them in Explorer.