class FollowResult
A data class that encapsulates the result of a follow operation on a SharePoint item, containing the followed item and the result status.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/userprofiles/follow_result.py
5 - 15
simple
Purpose
The FollowResult class serves as a container for information returned when a user attempts to follow a SharePoint item. It inherits from ClientValue and provides structured access to both the item being followed and the outcome of the follow request. This class is typically used in SharePoint user profile operations to track social following activities and their success/failure states.
Source Code
class FollowResult(ClientValue):
"""The FollowResult class returns information about a request to follow an item."""
def __init__(self, item=FollowedItem(), result_type=None):
"""
:param FollowedItem item: The Item property contains the item being followed.
:param int result_type: The ResultType property provides information about the attempt to follow an item.
For details on the FollowResultType type, see section 3.1.5.54.
"""
self.Item = item
self.ResultType = result_type
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
item: A FollowedItem object representing the SharePoint item that was targeted for following. Defaults to an empty FollowedItem() instance if not provided. This contains metadata about the item such as its URL, title, and type.
result_type: An integer value indicating the outcome of the follow operation. This corresponds to the FollowResultType enumeration (see section 3.1.5.54 of SharePoint documentation). Common values indicate success, failure, or specific error conditions. Defaults to None if not specified.
Return Value
Instantiation returns a FollowResult object with two accessible attributes: Item (the FollowedItem being followed) and ResultType (the integer status code of the operation). This object can be serialized as a ClientValue for transmission to/from SharePoint services.
Class Interface
Methods
__init__(item=FollowedItem(), result_type=None)
Purpose: Initializes a new FollowResult instance with the followed item and result status
Parameters:
item: FollowedItem object representing the item being followed, defaults to empty FollowedItem()result_type: Integer representing the follow operation result status (FollowResultType), defaults to None
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
Item |
FollowedItem | The SharePoint item that was the target of the follow operation, containing metadata like URI, title, and item type | instance |
ResultType |
int or None | Integer code indicating the outcome of the follow operation, corresponding to FollowResultType enumeration values (see SharePoint documentation section 3.1.5.54) | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.sharepoint.userprofiles.followed_item import FollowedItem
Usage Example
from office365.runtime.client_value import ClientValue
from office365.sharepoint.userprofiles.followed_item import FollowedItem
from office365.sharepoint.userprofiles.follow_result import FollowResult
# Create a followed item
followed_item = FollowedItem()
followed_item.Uri = "https://contoso.sharepoint.com/sites/team"
followed_item.Title = "Team Site"
# Create a follow result indicating success (result_type=0 typically means success)
follow_result = FollowResult(item=followed_item, result_type=0)
# Access the result properties
print(f"Followed item: {follow_result.Item.Title}")
print(f"Result type: {follow_result.ResultType}")
# Create with defaults
default_result = FollowResult()
print(f"Default result type: {default_result.ResultType}") # None
Best Practices
- Always check the ResultType property after a follow operation to determine if the operation succeeded
- The class is immutable after instantiation by design - create new instances rather than modifying existing ones
- Use this class as a read-only container for follow operation results rather than for initiating follow operations
- When creating instances manually for testing, ensure the result_type value matches the expected FollowResultType enumeration values
- The Item attribute should always contain a valid FollowedItem object, even if the follow operation failed
- This class inherits from ClientValue, making it suitable for serialization in SharePoint API communications
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class FollowedItem 75.2% similar
-
class FollowedContent 69.8% similar
-
class SocialRestFollowingManager 61.5% similar
-
class DlpClassificationResult 61.2% similar
-
class SharedWithMeViewItemRemovalResult 61.0% similar