Configure Smart Action Functions

Salespeople can define a smart action to take them directly to Microsoft Teams by entering a smart action in the Action Bar from their Opportunity page. This action will only be applicable if a team already exists for the selected opportunity record.

Salespeople can choose to create a team in Microsoft Teams by entering a smart action in the Action Bar from their Opportunity page in their sales application.
Note: While the example refers to the opportunity object, the following set up steps are similar for other objects such as custom object as well.
As an administrator, you must define the Create Team in Microsoft Teams and Go to Microsoft Teams smart actions in Application Composer.

Define the Create Team in Microsoft Teams Smart Action

Here’s how to define the Create Team in Microsoft Teams smart action function in Application Composer.
  1. Navigate to Configuration > Sandboxes to create and enter a sandbox with Application Composer.
  2. From the sandbox, open Application Composer from the Tools menu.
  3. Click Smart Actions, available from Common Setup.
  4. Fromn the Kind of Actions page, choose REST-based action, and then click Continue.
  5. Create the smart action with the following Basic Details:
    • Name: Create Team in Microsoft Teams
    • Object: Opportunity
    • Enabled: On
    • Mass Action: Off
    • For Availability, enter the following: Application: Sales
    • For Condition, enter microsoftTeamCreated equals “NO” in the Include all the following groups field.

    Here's an example of what the page looks like for the Opportunity object.

    Screenshot showing the review and Subit screen for the Create Team in Microsoft Teams smart action
  6. On the Action Details page, enter the REST metadata in the Path field of the selected smart action. /crmRestApi/resources/11.13.18.05/collaborations .
  7. From the Method drop-down list, select POST.
  8. Click Add and enter the following Request Body Parameters for the Create Team in Microsoft Teams smart acttion:
    Object Name Type Value Mandatory
    Opportunity ObjectName Static Opportunities True
    ObjectId Attribute Opportunity ID (OptyId True
    Name Attribute Name(Name) True
    Description Attribute Account(TargetPartyName) False

    TeamRelationshipName

    Static
    To get the value, follow these steps:
    1. In a sandbox, go to Application Composer.
    2. Click Relationships.
    3. Copy the name of the relationship for the Source Object = Object of interest and Target Object = Resource
    The TeamRelationshipName parameter value is used to retrieve the team members on the record. It is only required if you're using a custom relationship for the standard objects or if you're setting up this integration for a custom object.
    False
    Custom ObjectName Static Use API name of custom object.
    To get the value, follow these steps:
    1. In a sandbox, go to Application Composer.
    2. Expand node, then Custom Objects node. Objects node, then Custom Objects node.
    3. Click the custiom object you want.
    4. On the Overview page for the Custom Object, copy the API Name value to use as the ObjectName
    True
    ObjectId Attribute Custom object ID (ID field for the object) True
    Name Attribute Name(Name) True
    Description Attribute Account(TargetPartyName) False

    TeamRelationshipName

    Static
    To get the value, follow these steps:
    1. In a sandbox, go to Application Composer.
    2. Click Relationships.
    3. Copy the name of the relationship for the Source Object = Object of interest and Target Object = Resource
    False

    Here's a sample screenshot of what the Create Smart Action UI looks like:

    sample screenshot of what the Create Smart Action UI looks like.
  9. On the Confirmation Message page, you can define primary, secondary, and confirmation messages. Enter the following:
    • Primary Message: Your team will be created in Microsoft Teams in a few seconds.
    • Secondary Message: You can continue to use the application while it's being created. Please don't submit the action again.
    • Continue Button Label: OK
    • Cancel Button Label: Cancel
    • Confirmation Message: Your team OPPTY-{ATTRIBUTE_VALUE_NAME} in Microsoft Teams is created. Use the Go to Microsoft Teams action to go to the team .
  10. Check the details on the Review and Submit page.
  11. Click Submit.

Define the Go to Microsoft Teams Smart Action

Here’s how to define the Go to Microsoft Teams smart action function in Application Composer.
  1. Navigate to Configuration > Sandboxes to create and enter a sandbox with Application Composer.
  2. From the sandbox, open Application Composer from the Tools menu.
  3. Click Smart Actions, available from Common Setup.
  4. Create the smart action with the following Basic Details:
    • Name: Go To Microsoft Teams
    • Object: Opportunity
    • For Availability, enter the following: Application: Sales
    • For Condition, enter microsoftTeamCreated equals “YES” in the Include all the following groups field.
  5. On the Action Details page, for Object function action field, select GoToTeams which you previously defined in the Create an Object Function Server Script topic.
  6. Select the Object function returns a URL toggle.
  7. In the Browser Window Target field, select New Tab from the drop-down list as shown in this sample screenshot of what the Create Smart Action UI looks like.

    Screen showing the Action Details page for the Go To Microsoft Teams smart action

  8. Click Continue.
  9. Check the details on the Review and Submit page as shown:

    Screen showing the Review and Submit page for the Go To Microsoft Teams smart action

  10. Click Submit.

Salespeople can now add all existing members of their opportunity to a team in Microsoft Teams and start the collaboration directly from the Opportunities UI. This allows users of Microsoft Teams to interact with opportunity team members from their Sales application and add any required external resources with expertise to help win the deal. Using the Create Team in Microsoft Teams action in the opportunity, a dedicated opportunity team is created in Microsoft Teams for the opportunity team members. Once the team is created, users can use the Go to Microsoft Teams action to begin collaboration with the team.