How to change the Path of the file which comes from queue to different path in code

Hi Team,

I have a queue item value as shown below
Ex: PoFilePath=D:/Users/Li/Fort/123.pdf

But after extracting the queue item file path i nedd to check whether pdf file exist in it if not then

i have to check in other path like Ex:D:/Users/Li/One/Fort/123.pdf

How to write logic for it

Thanks in Advance
Likitha

Hi @vinjam_likitha

welcome to UiPath community!!!

for checking the file exist or not you can use Path exist activity in classic

if you plan to use modern activity you can use file exists activity

please refer the below example

image
first you can check the queue item file if exist again you can check for another file if the condition is met
hope it helps!!!

Hi @vinjam_likitha ,

You can make use of a classic activity called ‘Path Exists’ using this you can check whether the file is there or not. This activity returns True if the Input Path exists, False if not. This Boolean output you can use further to check in if condition or in a way you want to configure.

Attaching the official documentation,

Let me know if you have further queries.

Thanks,
Gautham.

Hi Vinjam,

Not knowing where a file’s location is before you search for it does make things more difficult which I would try to avoid. I think I would do something like this if you really can’t be sure:

What I do here is go through all the files in the folder and check if the filename matches what I expect. Make sure to set the “Include subfolders” property.

This does involve you having to split out the folder & the filename on the queue or you will have to use some string manipulation here to seperate out the filename & folder from the path.

Hope this helps!