I am using matches and regex to get matching strings in variable Laycan
but getting this error in assign
It did not find any matching string based on given regular expression and because of that it is passing null value to it.
no it has find 2 matches and I printed them using for each but I want to store the two matches in two different variables
string was - LAYCAN - 09/24/2019 – 09/26/2019
and the matches it fount were - 09/24/2019 and 09/26/2019
I saved the collection output of matches activity in variable named Laycan
now I have used assign as
assign laycanstart = Laycan(0).tostring but its giving error
What was the error?
object reference not set to an instance of an object. see screenshot above
help me write the code for stroring the output of matches which is a collection of two items in two different variables
Can you share the screenshot where in you are defining ‘Laycan’. How are you defining this?
tx for helping its working now. can you help me with handling the same workflow when there is not match found in that case I want to throw an exception message - no value found
Here it is.
I need to use exception activity and log it into log file
In the else part, just Throw an exception and handle that.
its again notemaildataextraction - Copy.zip (3.0 KB) working can you go through my xaml and let me know whats wrong
Pls verify the scope of your “Laycan” variable.
Is it “visible” for both activities?
EDIT:
Variable scope is not the problem, but the data - there is no match => Laycan is NULL => error.
It is easy to find in debug mode. Do you use this?
Cheers
no there is value inside Laycan
plz check my xaml attached above
No, unfortunately there is not
Run you WF in debug and check carefully variables at failure.
It looks like it’s not a logic issue. Please check for the types of variables you are trying to assign. Or any other properties or syntax.
Thanks,
Prasanta
I assume that there were logical errors with the flow in your xaml. I tried to fix the flow assuming your requirements. Kindly check the attached workflow.
emaildataextraction - fixed.xaml (17.3 KB)