I'm using the Retrieve Email Messages flow action in my PAD flow and it continuous to throw this error, "Failed to retrieve message with uid 1853". This is a similar issue to the one described in this post: https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Retrieve-Email-Messages-returns-weird-error/m-p/1395954#M9707
This is really frustrating. I'm not entirely sure why but this Flow is experiencing this issue in isolation. I have several carbon copies of this Flow with only minor changes to the actions, the most dramatic change being the "To" address the Retrieve Email Messages action looks for when performing - as well as changing the target folder path via a variable. Changing the folder path variable once changes the target folder throughout the flow.
Like I stated, I have other flows composed of the exact same actions with the primary difference being where the files are being placed and which email address is being used to filter the email messages with.
Here's the raw error information:
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.: Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Failed to retrieve message with uid 1853. ---> System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object arg0)
at Microsoft.Flow.RPA.Desktop.Modules.Email.Actions.EmailActions.RetrieveEmails(Variant imapServer, Variant username, Variant varPassword, Variant mailFolder, Variant fromContains, Variant toContains, Variant subjectContains, Variant bodyContains, Variant sentSince, Variant sentUpTo, Variant saveAttachmentsInto, Variant& retrievedEmails, Int32 serverPort, Boolean enableSsl, Int32 retrieveOnlyUnread, Boolean saveAttachments, Boolean markAsRead, Boolean acceptUntrustedCertificates)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.Email.Actions.RetrieveEmails.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)
I've tried the fixes @MichaelAnnis suggested in the attached post, but it's not making the Flow work anymore. I've also tried two full reboots, turn the computer all the way off, unplug, plug back in, turn on... nothing.
Some of my job is relying on this Flow's smooth operation. Arg.
Any suggestions as to what might be the cause?
****Edit:
I've built a much more condensed flow to test if PAD will throw the same or similar error for just the "To" string I supply.
It works, but now the Retrieve Email Messages behavior is way out of wack. I have it set to retrieve only read emails, and to only gather emails with a string in the "To" field. There's only 1 email that meets criteria of 9 total emails. Each run the Flow will wrongly grab EVERY email, not just the 1 qualifying email. If I change only the "To" field string, it behaves as normal and retrieves only the correct email. If I change the "To" string back to my desired target, it retrieves EVERY email.
In my primary flow, the one throwing the uid 1853 error, I can change the "To" field to anything other than my target string and it will work correctly.
Arg!