Get-Object

Prev Next

Summary

Retrieves an existing object.

Get-Object
    -Id

Returns an object object.

Parameters

Parameter

Type

Required?

Notes

Id

Int32

Yes

The object id.

Examples

Get an existing object

This example retrieves a specific object and outputs it as JSON.

# Retrieve a specific object by id
$entry = Get-Object -Id 14

Write-Output "Retrieved object '$($entry.Name)' (Id: #$($entry.ObjectId))"

# For debug purposes, convert the entity to output as JSON so we can see the available fields
Write-Output ""
Write-Output "JSON Results:"

$jsonOutput = $entry | ConvertTo-Json -Depth 10

# Output the entity
Write-Output $jsonOutput

Execution results:

Retrieved object 'Custodian' (Id: #14)

JSON Results:
{
  "ObjectId": 14,
  "Name": "Custodian",
  "Description": "Custodian Custom Object",
  "AllowCustomFields": true,
  "DefaultDisplayFormat": "%Name%",
  "KeyType": "Int32",
  "IsSystemObject": false,
  "IsListed": true,
  "ListSortOrder": 0,
  "NumberOfFields": 5,
  "Fields": [
    {
      "FieldId": 43,
      "ObjectId": 14,
      "DataTypeId": 1,
      "DataTypeName": "Basic Text",
      "Label": "Name",
      "IsRequired": true,
      "Position": 0,
      "Guid": 1615319873009,
      "IsSystemField": false,
      "IsReferenceValue": true,
      "DefaultValue": null,
      "CopyPreviousValueOnSaveAndNew": false,
      "Value": null,
      "ReferenceObject": null
    },
    {
      "FieldId": 44,
      "ObjectId": 14,
      "DataTypeId": 2,
      "DataTypeName": "Rich Text",
      "Label": "Notes",
      "IsRequired": false,
      "Position": 3,
      "Guid": 1615319873009,
      "IsSystemField": false,
      "IsReferenceValue": false,
      "DefaultValue": null,
      "CopyPreviousValueOnSaveAndNew": false,
      "Value": null,
      "ReferenceObject": null
    },
    {
      "FieldId": 58,
      "ObjectId": 14,
      "DataTypeId": 9,
      "DataTypeName": "Multiple Choice",
      "Label": "Locations",
      "IsRequired": false,
      "Position": 2,
      "Guid": 2446937452717,
      "IsSystemField": false,
      "IsReferenceValue": false,
      "DefaultValue": "MN\nCA\nNY\nTX\nFL\nOR",
      "CopyPreviousValueOnSaveAndNew": false,
      "Value": null,
      "ReferenceObject": null
    },
    {
      "FieldId": 97,
      "ObjectId": 14,
      "DataTypeId": 6,
      "DataTypeName": "Date Only",
      "Label": "Data Retained On",
      "IsRequired": false,
      "Position": 1,
      "Guid": 9947629964457,
      "IsSystemField": false,
      "IsReferenceValue": false,
      "DefaultValue": null,
      "CopyPreviousValueOnSaveAndNew": false,
      "Value": null,
      "ReferenceObject": null
    },
    {
      "FieldId": 98,
      "ObjectId": 14,
      "DataTypeId": 10,
      "DataTypeName": "Reference",
      "Label": "Media Log Entries",
      "IsRequired": false,
      "Position": 4,
      "Guid": 1735443070288,
      "IsSystemField": false,
      "IsReferenceValue": false,
      "DefaultValue": null,
      "CopyPreviousValueOnSaveAndNew": false,
      "Value": null,
      "ReferenceObject": {
        "ObjectFieldReferenceObjectId": 23,
        "ObjectFieldId": 98,
        "ObjectId": 3,
        "Object": null,
        "KeyType": "Int32",
        "DisplayFormat": "#%Ref% - %Val%",
        "IsSystemObject": true,
        "Name": null,
        "NumberOfDefaultValues": 0,
        "DefaultValues": []
      }
    }
  ],
  "CreatedByFullName": "Max Miller",
  "CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "CreatedOn": "2021-03-09T19:57:52.9935815+00:00",
  "CreatedBy": null,
  "LastUpdatedByFullName": "Carrie Johnson",
  "LastUpdatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",
  "LastUpdatedOn": "2024-06-21T14:03:20.3170071+00:00",
  "LastUpdatedBy": null
}