Cognito Forms: Selecting Individual Items From an Array
I have created an array, using the
.Split() functionality, I would like to now reference each item (
it I believe) in that array, specifically.
How do I achieve that?
The rest of this you don't need to read, but I'll try to provide more information.
I am now going to use an example of something that I might like to do, this is not literally all I want to do.
So. Let's say a user has input the following data in to the 'Inputta' field:
Now, in the 'Arraya' field, I have:
Let's say I would like to select the "
ddd" entry in that array, how would I do that?
I've tried using the
.Where() functionality, eg: ".Where(ItemNumber = 4)", but even if that did work (it doesn't), it would be no use for if I need to be iterative.
I've tried to play with the
.Select() functionality, but that's not helpful, either, as I can't find decent information on how it even works.
So, on to that iterative tip, to build on this example, I have a secondary requirement of the form, which is to pick an item from the array from an incremented integer.
We'll imagine I know how to increment an integer, and have that information already, either in a separately generated
.Split() field, or as an integer calculation in a Repeating Section.
How would I use the integer to find the array entry in the 'Arraya' field?
Basically, how would I select item 1 (from the second array), then item 2, etc?
This isn't a separate question, I'm just explaining further the requirement.
As an addendum, I'd love to know how to create an array of incremental integers leading to a pre-determined max number. ;-)
For the record, I have StartPaged this thoroughly.
- I can't find a full reference chart for the functions available anywhere online.
- The list on CF only lists a subset of the available functions (for example, the
.Select()array functionality is not listed)
- Everywhere else appears to handle other specific functions.
None of that is stated to cast any disdain anywhere, purely to indicate that I have looked, perhaps my StartPage Fu is just not that strong. Either way, apologies for asking here.