How to delete O365 Accounts in UiPath Studio (Use Outlook 365)?
When an account is selected to be used in the O365 activities, two things occur.
- A cache is created that contains a token for the account so that reauthentication and configuration is not necessary each time the workflow is run (at least not unless the token expires etc.) The cache that holds the token is usually found in one of these locations, (depending on which authentication flow is being used):
- The account name/email is stored in the xaml file so that it is visible in the accounts drop-down of the activity.
To remove the accounts that are listed in the activity itself, try the following:
Note: Before proceeding with the steps below, take a backup copy of:
- The project
- The folders %localappdata%\DataStore.Office365 and/or %appdata%\uipath\authentication\office365.tokens.cache before making changes to the project or removing files from the folders.
- Check for the cached accounts / tokens:
If the DataStore.Office365 file exists, make a backup copy of the DataStore.Office365 file and then try deleting the contents of the DataStore.Office365 file.
If the %appdata%\uipath\authentication folder exists, you can make a backup copy of the %appdata%\uipath\authentication folder and then remove the office365.tokens.cache files.
- After completing the step above, make a backup copy of the project if this step has not already been completed, and then open the project in Studio.
Click the account dropdown now, and see the accounts are still listed, but they will likely show a red (missing) beside each. To fix this, simply drag in a new Use Outlook 365 activity and the account dropdown should now be clear.
After dragging in the new activity, copy the Do sequence from the old Use Outlook 365 activity into the new activity and then delete the old Use Outlook 365 activity.
Example to remove account names from the Use Outlook 365 Scope Activity:
- Make a backup copy of the %appdata%\uipath\authentication folder and then remove the following files from the original folder:
- After doing so, open the project in Studio, and click the drop-down for the accounts. The account that was previously being used in the activity should now show as (missing).
- Pull in a new Use Outlook 365 activity.
- The accounts should be cleared in the new activity after doing so.