@MIA27 - yes you can chain multiple Collections within the same formula. e.g.:
ClearCollect(
MyCollection1,
{
Column1: "Text 1",
Column2: "Sample 1",
Column3: "A"
},
{
Column1: "Text 2",
Column2: "Sample 2",
Column3: "B"
}
);
ClearCollect(
MyCollection2,
{
Text1: "Some text",
Text2: "Some more text",
Text3: "Even more text"
}
Note in the above example, MyCollection1 is generated before MyCollection2 is generated. If there is no relationship/dependency between the Collections, it is more optiminal to generate all Collections together using the Concurrent function.
With this function, we do not need to use the semi-colon notation ( ";" ) and instead use the comma notation "," to separate each ClearCollect. (in the English version of Power Apps):
Concurrent(
ClearCollect(
MyCollection1,
{
Column1: "Text 1",
Column2: "Sample 1",
Column3: "A"
},
{
Column1: "Text 2",
Column2: "Sample 2",
Column3: "B"
}
),
ClearCollect(
MyCollection2,
{
Text1: "Some text",
Text2: "Some more text",
Text3: "Even more text"
}
)
)
If there is a dependency between Collections - in other words you want to create another Collection which uses data from Collection1, you can use the following pattern:
ClearCollect(
MyCollection1,
{
Column1: "Text 1",
Column2: "Sample 1",
Column3: "A"
},
{
Column1: "Text 2",
Column2: "Sample 2",
Column3: "B"
}
);
ClearCollect(
MyCollection2,
Filter(
MyCollection1,
Column3 = "A"
)
)