Functions that work with record and table values expose their fields within the function.
eg.
If I have a collection
Collect(myCollection, {field1:"value1", field2:"value2", field3:"value3"});
Collect(myCollection, {field1:"value4", filed2:"value5", field3:"value6"})I can perform a function on it and use the field names in the evaluation
LookUp(myCollection, field1="value1")
Where 'field1' is a field in the record or collection being evaluated.
This seems simple but is there a way to provide context for these feilds when multiple collections are being evaluated in nested functions
eg
If I have these two collections
Collect(myCollection, {field1:"value1", field2:"value2", field3:"value3"});
Collect(myCollection, {field1:"value4", filed2:"value5", field3:"value6"});
Collect(otherCollection, {field1:"valueA", fieldB:"valueB", fieldC:"valueC"});
Collect(otherCollection, {field1:"valueD", filedB:"valueE", fieldC:"valueF"})Now I want to perform the following function
ForAll( myCollection,
ForAll( otherCollection,
Collect(newCollection,
{newField1 : field1,
newField2 : field1,
newField3 : field2,
newField4 : fieldB}
)
)
)Notice I have assigned 'field1' to both 'newField1' and 'newField2'
What I really want is
newField1 : myCollection.field1
newField2 : otherCollection.field1
But I cant find any documentation on how to provide the context of the collection I am refering to.
I know there are better ways to perform this example function, it is only for illustration.
In production need to use a variety of other nested functions to decide what to to with the records being iterated through.
Any suggestions would be appreciated.