Use the For each chat of the user iterator to automate tasks by looping through all chat conversations of a specified user. This feature allows for actions such as reading messages and processing chats individually, facilitating efficient management of multiple chat threads within an automation workflow.

Prerequisites

Ensure a valid Microsoft Teams session is already be created.

Procedure

  • Double-click or drag the Loop action from the Loop package in the Actions palette.
  • Select the For each chat of the user option from the Iterator list.
  • Use the Session name field to select one of the following options:
    • Session name: Enter the name of the session used to open the presentation with the Connect action.

      (Optional) Click the Insert a value icon to select an existing variable that you have used to store the default session name.

    • Variable: Enter the name of the variable that you have used to store the session name.
  • Select one of the following Chat type options:
    • One-on-One: Loops only through individual (1:1) chats​.
    • Group: Loops only through group chats (more than two participants).
    Note: If you do not select an option, then no chat will be retrieved. Ensure you select atleast one option.​
  • Use the Start date and End date options to filter chats based on their creation or activity date.
  • In the Assign chat details to variablefield, choose either Multiple variables or Dictionary variable to save the output:
    • Multiple variables: Assigns each retrieved value (for example, ID, chatType, and webURL) to a separate variable enabling you to map each team detail to a specific variable. Do following steps for each variable:
      • Click Add variable mapping.
      • Enter the Key of the variable.
      • In the Map to variable field, choose a variable where the data will be saved.
      • Click Add for this data to be saved to the configured variable.
    • Dictionary: stores all values in a dictionary object with key-value pairs.