How to convert a path string to Local IResource

Hello,

After migrating to the newest version of Studio, the move file activity requires a Uipath Local IResource type instead of a string.

How do I make the conversion? I noticed we can use an Output from path Exist acitvity but I would prefer a cleaner sollution.

Thank you!

Hi @octavioelliot ,

In my case, I used a string argument where I add the path that I need to use in each needed sequence.
Finally, this argument allows me to move, delete or read files.

For example:

Have a great day!
Please let me know if you need anything else.

Hello @Pamela_Sibaja,

Thank you for the reply but I am afraid I have a different issue.

My goal is to figure it out how to convert from string to Uipath Local IResource type.

Best regards,

Hi,

We can get IResource variable using PathExists activity as the following.

BTW, perhaps you might upgrade System.activities package to 22.4.5 or 22.10.3, if possible. Because normally textbox for path of string type is displayed ion the activity as the above image.

Regards,

2 Likes

@Yoichi

Thank you, I noticed we can use an Output from path Exist activity and is indeed a workaround, but I would prefer a cleaner sollution. (Ex: Iresourcetype = strpath.Convert(resource)).

It should have a way but I failed to find online.

Best regards,
Octavio

@octavioelliot
just a preview on the technical details. Currently the UiPath internal implementation do not expose a method/constructor… which allows us to create a IRessource / ILocalRessource e.g by a single line statement from a string like: new FileSystemLocalItem(…

So we go for the workarounds / hoping that the upcoming packages will give some alternates to us.

1 Like

@ppr

Well, it is what it is!

Thank you very much for the explanation! Lets wait for a constructor though!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.