How to compare a variable to list folders contained in a folder

yes, you are right dear but here the problem is in last log msg if use index o it shows the last element and if i use any number bigger than 0 then it says Index was out of range that means outside the 1st foreach loop the value in list is only one. and in second for each loop it does the same showing last element.

and if i use this log message inside the 1st for each loop then it shows all the expected result.

2 Likes

@deepa.barode
Actually we have got only one value, foldername from the folder path so only for index 0 we can get the value as it is a folder name (a single value of string type), so if we put 1 as index it wont work, to be simple we are looking for inner folder name in a folder, we need to check whether the folder has only one folder or not…
if 0 alone work and it is the first and last element
–then even using log message inside for each loop will fetch you only one value, foldername value, but from all the folder path you have

Cheers @deepa.barode

1 Like

any issues still buddy @deepa.barode
Kindly correct me if i m wrong with the previous comment
Cheers

Hy buddy,
Thanks, but we have number of folders in target folder so that was not a problem.I think i have figured out the problem.

1 Like

thats great…what was the issue with that
Cheers @deepa.barode

So the mistake was the initializing of the second list it should be in the beginning of the workflow as we are using 2 lists in this workflow. formerly i was using it in 1st for each loop so that is why it was getting initialized for each item and have been getting overwritten.that is why when we use it outside that loop it gives the last element of the list that means index of that list is 0(only one element). Anyway thanks for your help.
cheers:star_struck:

2 Likes

Fine
Cheers @deepa.barode