Use the For each message in a channel iterator to automatically go through every message within a specified Slack channel. It enables you to automate tasks like analyzing, archiving, or processing all messages in a channel.

Procedure

  • Double-click or drag the Loop action from the Loop package in the Actions palette.
  • Select the For each message in a channel 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 you used in the Connect action.

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

    • Variable: Enter the name of the variable that you have used to store the session name.
  • Specify the Channel to retrieve its details using the following options:
    • Channel name: Specify the Channel name inside a specific team.
    • Channel ID: Specify the unique ID of the Channel.
  • Use the Start date and End date options to filter messages within a specified date range.
  • In the Assign message details to a variable field, choose either Multiple variables or Dictionary variable to save the message details in the output variable:
    • Multiple variables: Assigns each retrieved value of a specific key (for example, messageID, message, sentUserID, sentUserName, createdDateTime, modifiedDateTime) to a separate variable enabling you to map each channel 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.