so lets say clothesType is declared as string in db. in a rule, i am iterating over this variable using for each loop. the problem is i can't declare the clothesType as an array as it would affect existing functionality. If i could, it would solve the problem. So, are there any built in appian functions that i can use to run a for each loop over a value that is accepting one value only?
Discussion posts and replies are publicly visible
So you want to store something like a comma-separated list in a field? If yes, you can just use the split() function to turn that into a list of values.
I'm unclear whether this is the use case OP was trying to describe (though it seems like one of the more likely options, to be fair). I need to interject here that if someone is tempted to do this, they should strongly consider storing their list-of-values-in-text as a JSON string, to utilize the pre-built JSON conversion / parsing functionality, since even something as simple as a comma-separated list becomes a giant hassle to implement and debug the second you need it to store user-entered text, etc.
this is getting me the correct behavior. but for my use case, i am running 35 id numbers in a for each loop to check if they are formatted correctly.
i.e. if i run the test case like this:
it will fail because it is not declared in the db as an array (and i can't modify it since its used else where as well).
so is there a way around this?
Do they all need to be stored in the same row in the DB? I'm a little unclear what exacly you're trying to accomplish by this multiple ID thing.
no, actually, the value is coming from am excel file and stored in staging table, so i'm getting the values in the process model from the same pv! that is writing the data to the table. So the issue is that since the value is already declared as not an array i have to somehow check one by one, so now i'm thinking i will create a loop in the process model in the index of the picture here and store the values in an array variable.