Invoke code map variable size limit

Good afternoon,

I’m developing a bot where I read a text file in an invoke code using Python. The result is saved in a list that is mapped to an array of strings. This file is very large, and I had tested it with a sample containing 171,263 lines, which worked correctly. However, when I tested it with another file containing 175,326 lines, it’s not working. The variable that should receive the value in the mapping is turning null.

I have two questions:

  1. Would it be possible for future versions to make the invoke code activity throw an error when encountering this kind of issue with mapping variables?
  2. Is there anything I can do to make the mapping work? Perhaps adjust some parameter that controls the size limit of arguments or something similar… Currently, I have a temporary solution of returning it as a string and then using the Assign activity to split it, but I’m wondering if there’s a better solution.

Thanks in advance.

I’m not sure why that would happen, but if the same code works with a file that has less line, it must be some kind of issue with python embedded.

But you easily read the file content of a file from openrpa/.dot net using ReadLine or ReadAllText
so in an assign activity, you can assign this to an array of strings

System.IO.File.ReadLines("c:\file.txt").ToArray()

or if you just want to read it all as text to a string variable, use

System.IO.File.ReadAllText("c:\file.txt");
1 Like

Thank you very much.

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