Variable looses value


#1

I’ve build a process that it seems like it is assigning the value to a variable, but then when checking it further down in the process shows as blank.

Find the xaml file attached and the test file I’m usingtest.zip (224 Bytes)
. The variable in particular is ‘task’ and it is assigned correctly in LoopThroughContent but shows blank in CheckCorrectInfoReceived.

I might be missing something silly, but I’ve been through all day with this and I’m getting crazy

Any ideas?
Main.xaml (39.4 KB)

Thanks


#2

Hey @selrac

You have defined two “task” variables with different scope so delete one task variable having sequence scope and then try to run and let me know :slight_smile:

Regards…!!
Aksh


#3

Thanks Aksh.

How did you find that? What is the best way to find this type of errors?

I still have a problem as the condition task=“Khalix” is returning False. Anyway, I get to this tomorrow. Too long of a day…


#4

This was related with clearly scope of variable problem because as you said this is working in one scope and same name you are using without assignment and all so just checked all variables scope and uipath studio will help you to identify these kind of error as well.

what i have observed in text file there is space after the names like From: name so you can use “trim()” function on string and if you are still getting no task variable value then check the attached workflow.

Try with this attached workflow and let me know :slight_smile:
*Just change the file path and filechangetrigger path.

Main (8).xaml (39.6 KB)

Regards…!!
Aksh


#5

Thanks Aksh for the advice. Trim() sort out the problem. I can move forward now. :grinning: