Getting data type issue while passing the file to IXP Extract document type data activity

Description

Hi There,
I have created a small project in IXP and working fine with a single file.
Now when i want to loop multiple files to process i took a assign activity and passed the file path where all files are available.
Now i am getting the error while passing the file in the for each during the iteration.
Can you please help on the same?

Error - Cannot assign from type ‘System.String’ to type ‘UiPath.Platform.ResourceHandling.IResource’ in Assign activity ‘Assign’.

arrInputFiles - Array of String

Link

Date

2025-11-18

@avinashy

as per error looks like it needs a different type and you are sending string

to convert try this LocalResource.FromPath(givepathOrPathvariable)

cheers

You’re getting this error because IXP expects an IResource object, not a plain string file path.

  • arrInputFiles = Array of String → good for listing file paths.
  • But when you pass each file path to an IXP activity, it expects IResource, NOT String.
  • So UiPath throws:

Cannot assign from type ‘System.String’ to type ‘UiPath.Platform.ResourceHandling.IResource’

You must convert the file path (String) into an IResource using:

resourceFile = Resource.FromFile(currentFilePath)

Exact Steps

  1. Create variable:
    currentResource → Type: UiPath.Platform.ResourceHandling.IResource
  2. In For Each (item type = String):
  • item = full file path
  1. Use an Assign:
    currentResource = Resource.FromFile(item)

  2. Pass currentResource into IXP activity.