ERROR : Source: Assign "Message: Object reference not set to an instance of an object."


#1

Hi,

Im trying to capture hyper link of element by using Matches activity . If hyperlink is not present it should return NULL, but throwing an ERROR. Attached WF pls help. In this WF Hyperlink "View Detalis " is not present it should return NULL. splitstring.xaml (10.6 KB)


#2

Remove unreferenced variables if not using.
Thanks,
Jiban


#3

Removed,but Im getting same error.


#4


It gives you the result, not the error. But i don’t know what you are expecting in message box.
Thanks,
Jiban


#5

Hi Jiban,

I’m trying to store the result in a variable, message box is just an output for me. In this case if the regex doesn’t match, NULL used be stored.I’m getting Error Pls Help


#6

Try outputting the Count of the matches, so like
iEnumResult.Count.tostring

If that shows 0, then it’s nothing. The “IsNothing()” might not be working correctly. You can alternatively have the condition as: iEnumResults.Count = 0


#7

HI @ClaytonM,
How to count the matches can you pls provide us an example


#8

Hi. Refer to the example in my last post. You can take the variable you used and add a .Count on the end

iEnumResults.Count

To output in message box add .ToString on the end

iEnumResults is essentially a list or array of matches.


#9

Sorry @ClaytonM can you pls provide me your last Post.


#10

Here is what I mean:

Hopefully that makes it more clear. Thanks.


#11

@ClaytonM ThankYou So Much its working Fine.