Any idea how to implement below scenario in ab initio.<\/p>\n
how to use the value of ‘i’ from ‘for’ loop to concat and create the name of input fields and use them in a ‘if’ logic inside for_loop.<\/p>\n
I have used string_concat but ‘i’ value is not getting assigned .<\/p>\n
Below is my code<\/p>\n
for(let int i=1, i< in.no_of_loop)
\nbegin
\nIf(string_substring(string_concat(“in.”,“field”,(string(“”)) i),1,2)=‘AP’)
\nV_temp =“M”;
\nElse
\nV_temp = “N”;
\nEnd<\/p>\n
I want the if condition will resolve like below<\/p>\n
For 1st iteration i=1:<\/p>\n
If(string_substring(in.field1,1,2)=“AP”)<\/p>\n
For 2nd iteration i=2:<\/p>\n
If(string_substring(in.field2,1,2)=“AP”)
\n.
\n.
\n.<\/p>\n
And so on till the value of ‘i’<\/p>","upvoteCount":2,"answerCount":4,"datePublished":"2025-06-09T18:02:48.525Z","author":{"@type":"Person","name":"Ocean25","url":"https://community.spiceworks.com/u/Ocean25"},"suggestedAnswer":[{"@type":"Answer","text":"
Any idea how to implement below scenario in ab initio.<\/p>\n
how to use the value of ‘i’ from ‘for’ loop to concat and create the name of input fields and use them in a ‘if’ logic inside for_loop.<\/p>\n
I have used string_concat but ‘i’ value is not getting assigned .<\/p>\n
Below is my code<\/p>\n
for(let int i=1, i< in.no_of_loop)
\nbegin
\nIf(string_substring(string_concat(“in.”,“field”,(string(“”)) i),1,2)=‘AP’)
\nV_temp =“M”;
\nElse
\nV_temp = “N”;
\nEnd<\/p>\n
I want the if condition will resolve like below<\/p>\n
For 1st iteration i=1:<\/p>\n
If(string_substring(in.field1,1,2)=“AP”)<\/p>\n
For 2nd iteration i=2:<\/p>\n
If(string_substring(in.field2,1,2)=“AP”)
\n.
\n.
\n.<\/p>\n
And so on till the value of ‘i’<\/p>","upvoteCount":2,"datePublished":"2025-06-09T18:02:48.596Z","url":"https://community.spiceworks.com/t/ab-initio-fetching-i-value-from-foor-loop/1213589/1","author":{"@type":"Person","name":"Ocean25","url":"https://community.spiceworks.com/u/Ocean25"}},{"@type":"Answer","text":"
First, welcome to the community!<\/p>\n
Next, I’m assuming that Ab Initio is a specific product/platform you’re working with? Can you tell us a bit about what your end result is supposed to look like?<\/p>","upvoteCount":0,"datePublished":"2025-06-09T18:29:33.003Z","url":"https://community.spiceworks.com/t/ab-initio-fetching-i-value-from-foor-loop/1213589/2","author":{"@type":"Person","name":"Jay-Updegrove","url":"https://community.spiceworks.com/u/Jay-Updegrove"}},{"@type":"Answer","text":"
The end result of if condition will look like below<\/p>\n
For 1st iteration i=1:<\/p>\n
If(string_substring(in.field1,1,2)=“AP”)<\/p>\n
For 2nd iteration i=2:<\/p>\n
If(string_substring(in.field2,1,2)=“AP”)<\/p>\n
field1 and field2 names should be generated using the string_concat or any other function<\/p>","upvoteCount":1,"datePublished":"2025-06-09T18:49:04.930Z","url":"https://community.spiceworks.com/t/ab-initio-fetching-i-value-from-foor-loop/1213589/3","author":{"@type":"Person","name":"Ocean25","url":"https://community.spiceworks.com/u/Ocean25"}},{"@type":"Answer","text":"
So what is this part supposed to be doing?: (string(“”)) i
\nI suspect a typo there…<\/p>","upvoteCount":1,"datePublished":"2025-06-09T19:28:56.336Z","url":"https://community.spiceworks.com/t/ab-initio-fetching-i-value-from-foor-loop/1213589/4","author":{"@type":"Person","name":"craigrrr","url":"https://community.spiceworks.com/u/craigrrr"}}]}}