Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am working with Salesforce Chatter and trying to figure something out.
The three primary tables I am working with that I am stuck on are User, FeedComment and CollaborationGroupFeed.
Both the FeedComment and the CollaborationGroupFeed have a ParentID and a CreatorID. The ParentID for CollaborationGroupFeed should be the GroupID (another table), and the ParentID for FeedComment should be the CollaborationGroupFeed. The CreatorID for both of these should be the UserID.....
Is there a way have these Parent and Creators point to their respective parent or the UserID for the creator without renaming it? For example, I still want CollaborationGroupFeed.CreatedBy to have the name CreatedBy, but I want it to have the value of the UserID.
I have attached the code I am working with below. Currently the only way i can think to associate it is by renaming. If I do it this way however, there is no real way to differentiate between a comment creator and a groupfeed creator.
A second question- When it shows the FeedComment or GroupFeed "CreatedBy" it shows the UserID... how would i write the script to show the User's Name (field in usertable is [User Full Name])? It is not much help to just show the ID, but since the user's name is located in a separate table, I am unsure of how to show their name.
Any help is greatly appreciated.
LOAD
Alias as [User Alias],
City as [User City],
Country as [User Country],
Department as [User Department],
Division as [User Division],
Email as [User Email],
FirstName as [User First Name],
Id as [UserID],
IsActive as [User Is Active],
LastLoginDate as [User Last Login Date],
LastName as [User Last Name],
Name as [User Full Name],
State as [User State],
Title as [User Title],
Username as [User Username],
UserType as [User Type];
SQL SELECT
Alias,
City,
Country,
Department,
Division,
Email,
FirstName,
Id,
IsActive,
LastLoginDate,
LastName,
Name,
State,
Title,
Username,
UserType
FROM User;
LOAD
Body as [Group Feed Body],
CommentCount as [Group Feed Comment Count],
CreatedById as [UserID],
Id as [GroupFeedID],
LikeCount as [Group Feed Like Count],
ParentId as [GroupID], //ParentID of the group feed is the group
Type as [Group Feed Type];
SQL SELECT Body,
CommentCount,
CreatedById,
Id,
LikeCount,
ParentId,
Type
FROM CollaborationGroupFeed;
LOAD
CommentBody as [Feed Comment Body],
CreatedById as [UserID],
CommentType as [Feed Comment Type],
CreatedDate as [Feed Comment Created Date],
FeedItemId,
ParentId as [GroupFeedID];
SQL SELECT
CommentBody,
CreatedById,
CommentType,
CreatedDate,
FeedItemId,
ParentId
FROM FeedComment;