Upload extracted data from outlook using matches(Regex) into table, so I can bulk add into Queue

I am extracting vendor information from outlook email body by using regex.
Instead of using multiple matches, I entered regex patterns into a table and applied for each to extract multiple values from the body. Then, I tried to assign extracted regex value into a different table, so I can upload into queue. However, I am keep getting this message…

“Assign: Object reference not set to an instance of an object.”

I have tried all kinds of methods and still can’t find the solution.

Please help…

Hi @David_Han,

Need more context on this, can you share a screenshot of the implementation and the “assign” activity that’s failing? Most likely you’re referencing a null variable.

Hello @Edwin_Barahona,

Thank you for the prompt response!
below is the error message. Also, I just attached the file…
GetInfo_Email.xaml (20.5 KB)


Basically it means you have nothing/null. 1 or 2 scenarios.

Scenario 1:
If its all the same workflow, it means your Regex pattern is not getting a match. (Its likely this from the screenshot I am looking at).

Scenario 2:
If its from a separate workflow (passed in as argument) then its likely a missing argument connection.

You can use a system.text.regularexpression.Regex.IsMatch(yourstring, YourRegexPattern) to check IF there is a match BEFORE trying to extract.

Got a sample email? Or sample text with your expected outout.
(De-identify your data also).



1 Like

Thank you so much for your help @Steven_McKeering !

I actually found what the error is.
The error is that the for each was not exiting after it went through all the rows in the table. In fact, the error occurred as it was trying to loop for the 8th time after “postal Code”
Could you please advise me how to make the loop to exit as there are no more rows to apply?
Then, move on to next activity which is to add values into the second table where I created?

Thank you,