Newer Version Available

This content describes an older version of this product. View Latest

Record Object Examples

These code examples demonstrate how the Record object contains different information depending on whether your canvas app appears in the publisher or the feed.

Canvas App in the Publisher

If your canvas app appears in the publisher, the Record object contains different information depending on whether the publisher appears on a user record, a group record, or an object record.
User Record
The Record object Id is the User.Id and the Type is User.
1"record":{
2    "attributes":{
3        "type":"User",
4        "url":"/services/data/v54.0/sobjects/User/001xx000003DGWiABC"
5        },
6    "Id":"001xx000003DGWiABC"
7    }
Group Record
The Record object Id is the CollaborationGroup.Id and the Type is CollaborationGroup.
1"record":{
2    "attributes":{
3        "type":"CollaborationGroup",
4        "url":"/services/data/v54.0/sobjects/CollaborationGroup/001xx000003DGWiXYZ"
5        },
6    "Id":"001xx000003DGWiXYZ"
7    }
Object Record
The Record object Id is the object Id and the Type is the object name, for example, Account.
1"record":{
2    "attributes":{
3        "type":"Account",
4        "url":"/services/data/v54.0/sobjects/Account/001xx000003DGWiAAO"
5        },
6    "Id":"001xx000003DGWiAAO"
7    }

Canvas App in the Feed

If your canvas app appears in the feed, the Record object always contains the feed item information whether the feed is on a user record, a group record, or an object record.
The Record object Id is the FeedItem.Id and the Type is FeedItem.
1"reoord":{
2    "attributes":{
3        "type":"FeedItem",
4        "url":"/services/data/v54.0/sobjects/FeedItem/001xx000003DGWiAAO"
5        },
6    "Id":"001xx000003DGWiAAO"
7    }