I have an interesting problem that has me scratching my head.
So I have a spreadsheet that has email data like categories and message-ids. Some in the category column are blank and some have categories, and most have message-ids, but sometimes that’s blank too.
The bots job is to run through a get outlook mail message for the last week and check if any categories have changed or were updated. If a blank category how has a category or a category has been changed, I want the bot to match the message-ids and update a row accordingly with the updated category in the spreadsheet.
My bot runs and I have tried a million different configurations, but it still will not update the categories.
Instead of matching the data in the spreadsheet why can’t you just overwrite the data entirely each time this would simplify the process and save time by avoiding the matching logic. You could approach this as follows:
Retrieve All Outlook Emails: Fetch the emails for the desired date range, extracting Message-ID and Category for each one.
Clear Existing Data in the Spreadsheet: Clear the rows in the spreadsheet where email data is stored.
Write All New Data: Write the entire dataset from the Outlook emails (with updated categories and message-ids) back into the spreadsheet.
You can use Use Excel Application Scope with a Write Range or Clear Range & Get outlook mail messages to get this done.
That is a good idea, but the sheet has thousands and thousands of rows of data of emails, and I really just need to update a few dozens rows each run when the categories change. The bot can’t grab all emails from months and months.
Then you can use the Lookup Range activity to search to search for the Message-ID You will get output as cellAddress, which will store the address of the matched cell if it is a match then you can use write cell to overwrite the data.