"Take random" from list or table - access random line number later

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Hi,

if I take a random line from a list or table, what is the best approach to access the same line later in the project (e.g. I want to delete this exact line, after a couple of steps or at the end of the run)?

Would be great if in the step "Table processing - Take Line (random) would be an additional box, where a variable can be set which takes the value of the (random taken) line nr, so this variable can be used later to process this line number further.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Once you take the line and put it to a variable or variables they will always be available in the template while the thread is running even if you delete the line.
 

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Hi bigcajones,

thank you for your answer. Okay, I know that the values of a line in variables are accessible later in the project, even if the line is already deleted from the table or list in the meantime. But for example I have a job to do, where I have to delete the previous selected random line only if all steps in the project went well and if something fails the random line should stick for the next run. So is there a away to directly access the line number of a "Take line (random)"-step later in a project?

At the moment I'm doing this with a auxiliary construction: Count number of lines in a table --> set this number to a variable. Then use a random step, starting at 0 and ending at the "number of lines-1" variable. So now I can take a random line from the table and have the line number in an additional varible for later use. This works ok, but I'm wondering if there is a simplier solution.

Thank you.
 

s41mm3r

Client
Регистрация
23.01.2013
Сообщения
47
Благодарностей
3
Баллы
8
Could you not remove line containing text {-variable.currentline-}? Or if steps for delete are met, write variable to file? That way if you need to manually check for certain details you can or you can create another template that loads main list and a seperate list called "to be removed" then it's a simple case of taking a line from to be removed list and then remove line containing text {-variable.toberemoved-} from main list.
 
  • Спасибо
Реакции: morpheus93

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
Thank you s41mm3r, willl try your approaches.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)