Change Label Or Move Email To Another Folder In Gmail Using UiPath.GSuite.Activities

How to move an email to folder or label an email in gmail using GSuite activities?

In Gmail, folders are referred to as Labels.

To change labels for an email in Gmail using Classic UiPath.GSuite.Activities activities, follow the steps below

  1. Install UiPath.GSuite.Activities package from https://pkgs.dev.azure.com/uipath/Public.Feeds/_packaging/UiPath-Official/nuget/v3/index.json Official feed.
  2. Drag the Get Mail Messages activity into a Google Workspace Scope activity from UiPath.GSuite.Activities package to workflow and configure the GSuite application scope with necessary details. (Refer to GSuite Application Scope).
  3. Now use the Change Labels activity from the same package while providing the from the output of the Get Mail Messages activity above.
  4. Edit the NewLabels collection in the Change Labels activity to add the labels for the email. All the existing labels for the email would be removed and the labels in this list would be added to the email.
  5. Run the process.

Note: Add labels that already exist in the Gmail account. If any of the labels provided in the NewLabels collection don't exist, it will throw an error.

For example, if the label "testlabel" does not exist in the Gmail account, the error "Change Labels: You do not have the following labels: testlabel. Parameter name: NewLabels" would be thrown.

For modern activities, use the Apply Gmail Labels activity from the UiPath.GSuite.Activities package.