Instead of using for each, use this LINQ in assign activity for this.
attachmentNamesArray = savedAttachments.Select(Function(filePath) Path.GetFileName(filePath)).ToArray()
Instead of using for each, use this LINQ in assign activity for this.
attachmentNamesArray = savedAttachments.Select(Function(filePath) Path.GetFileName(filePath)).ToArray()