Hi,
The following results in a collection NewColl, with three rows in it...
ClearCollect ( NewColl, Table ( { r1 : 1 } , { r1 : 2 } , { r1 : 3 } ) ) ;
However, if one or more fields are added to the row being collected, then the table is lost...
ClearCollect ( NewColl2, { Usr: "SomeUser", UsrId : 222 , RRevision : Table ( { r1 : 1} , { r1 : 2 } , { r1 : 3 } ) } ) ;
The expectation for the second collection was that the table would be treated as a nested table, much like when using the GroupBy function. Instead the table just disappears. See attached screenshots.
Both the above statements are accepted by the Intellisense as being ok syntactically.
Other similar problems occur with code examples below where they are all syntactically ok as far as Intellisense is concerned, but the nested table is lost in every case, whether the table is coded using the Table() function or a table is returned from the Split() function. This caused downstream problems when subsequent code was written on the basis that it was ok, because Intellisense didn't reject it. Is there a reason why tables can't be gathered as nested tables into collections in this fashion and if not, why didn't Intellisense display some kind of warning ?
ClearCollect(NewColl,
ForAll(ColRevisionReadHistory,
{Usr: ThisRecord.User, UsrId : ThisRecord.UserId, RRevision : Split(ThisRecord.ReadRevision,",")}));
Clear(NewColl);
ForAll(ColRevisionReadHistory,
Collect(NewColl,{Usr: ThisRecord.User, UsrId : ThisRecord.UserId, RRevision : Split(ThisRecord.ReadRevision,",")}));
Clear(NewColl);
ForAll(ColRevisionReadHistory,
Collect(NewColl,{Usr: ThisRecord.User, UsrId : ThisRecord.UserId, RRevision : Table({r1 : 1},{r2 :2},{r3 :3})}));
Clear(NewColl);
ForAll(ColRevisionReadHistory,
Collect(NewColl,Patch({Usr: ThisRecord.User, UsrId : ThisRecord.UserId}, {RRevision : Table({r1 : 1},{r2 :2},{r3 :3})})));
Clear(NewColl);
ForAll(ColRevisionReadHistory,
Collect(NewColl,Patch({Usr: ThisRecord.User, UsrId : ThisRecord.UserId}, {RRevision : Table({r1 : 1},{r2 :2},{r3 :3})})));
ClearCollect(NewColl, {Usr: "", UsrId : "", RRevision : Table()});
ForAll(ColRevisionReadHistory,
Patch(NewColl,{Usr: ThisRecord.User, UsrId : ThisRecord.UserId}, {RRevision : Table({r1 : 1},{r2 :2},{r3 :3})}));
ClearCollect(NewColl, {Usr: "", UsrId : "", RRevision : Table()});
ForAll(ColRevisionReadHistory,
Patch(NewColl,{Usr: ThisRecord.User, UsrId : ThisRecord.UserId}, {RRevision : Split(ThisRecord.ReadRevision,",")}));
ClearCollect(NewColl,
ForAll(ColRevisionReadHistory,
{Usr: ThisRecord.User, UsrId : ThisRecord.UserId, RRevision : [Split(ThisRecord.ReadRevision,",")]}));