Assign: Object reference not set to an instance of an object string gmail

Iam using this to get attachment name from gmail
a = CType(item.Attachments.FirstOrDefault, Attachment).Name

But Im getting an error.
Pls help me out

Hi @Abhilasha_Sreenivasan,

Are you still having this issue?

The issue normally occurs when a variable has not been initialised (given a value). Try putting an Assign before the activity throwing an exception like so:

MyVar = ""

1 Like

Thanks! I’ll try it