Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

When you create a chatter poll you create the poll choices separately so these are most likely a separate Sobject.

Is there any way to access either the choices in the poll or the votes for a particular choice?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

Poll votes are not currently exposed and most likely never will be since if these objects were exposed there would be no way to keep the votes anonymous. See this idea for the option to create polls with public vs. private votes.

Poll choices are stored in the FeedPollChoice Sobject. However, this is only accessible through the chatter REST api. You can't even get describe information for this object through apex or the metadata api.

share|improve this answer
    
How exactly do you access the FeedPollChoice sobject? I can't seem to find it anywhere... –  ehime Mar 25 '13 at 23:25
add comment

If you use the new Chatter in Apex feature (formerly "Connect in Apex") that is available in dev preview in Spring 13 and is expected to GA in Summer 13 you can:

  • post feed polls: ConnectApi.ChatterFeeds.postFeedItem(community id, feed type, subject id, FeedItemInput including poll info, null)
  • get information about polls (choices and results, not individual votes): ConnectApi.ChatterFeeds.getFeedPoll(community id, feed item id) / ConnectApi.ChatterFeeds.getFeedItem(community id, feed item id)
  • vote on polls: ConnectApi.ChatterFeeds.voteOnFeedPoll(community id, feed item id, choice id)

Spring 13 dev preview doc is in here: http://www.salesforce.com/us/developer/docs/chatterapi/index.htm

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.