Hi guys,
So i made a collection that holds all the information about a few Trainings that were selected. This collection is used to trigger a power automate flow that exports that collections data into a excel file. See picture below.
I am now trying to add a column to that collection that holds all the Trainees names, attending that training. The data is all located into Dataverse. Trainings <-> Trainees is a many to many relationship.
I tried the following codes but with no succes:
Collect(
colCevoraExportList1,
""
);
Clear(colCevoraExportList1);
ForAll(
// The next filter returns me all the training records within the galTrainings gallery
Filter(
Trainings,
Training in galTrainings.AllItems.Training
),
Collect(
colCevoraExportList1,
{
Name: Name,
Training: Training,
CreatedOn: 'Created On',
DurationInDays: 'Duration In Days',
EligibleForSubsidy: 'Eligible For Subsidy',
IsDeleted: 'Is Deleted',
IsSent: 'Is Sent',
Organiser: Organiser,
Price: cref8_price,
PriceVatExcluded: 'Price VAT Excluded',
PriceVatIncluded: 'Price VAT Included',
Remarks: Remarks,
StartDate: 'Start Date',
Summary: Summary,
TrainingPaymentMethod: 'Training Payment Method'.Name,
TrainingType: TrainingType.Name,
VatInvoice: 'VAT Invoice',
YearStartDate: 'Year Start Date',
Trainees:
// im an trying to get all the Trainees 'First Name' in a column. I need this because i use the collection to Export the selected trainings in a Excel file
Concat(
LookUp(
Trainings,
Training = ThisRecord.Training && 'Created On' = ThisRecord.'Created On'
).Trainees,
'First Name' & ", "
)
}
)
);
//i use this function on a Gallery which return me all the Trainees attending the selected Training on a "Details page"
/*LookUp(
Trainings,
And(
ThisRecord.Name = varSelectedTraining.Name,
ThisRecord.'Created On' = varSelectedTraining.'Created On'
)
).Trainees*/
Collect(
colCevoraExportList1,
""
);
Clear(colCevoraExportList1);
ForAll(
Filter(
Trainings,
Training in galTrainings.AllItems.Training
) As A,
Collect(
colCevoraExportList1,
{
Name: A.Name,
Training: A.Training,
CreatedOn: A.'Created On',
DurationInDays: A.'Duration In Days',
EligibleForSubsidy: A.'Eligible For Subsidy',
IsDeleted: A.'Is Deleted',
IsSent: A.'Is Sent',
Organiser: A.Organiser,
Price: A.cref8_price,
PriceVatExcluded: A.'Price VAT Excluded',
PriceVatIncluded: A.'Price VAT Included',
Remarks: A.Remarks,
StartDate: A.'Start Date',
Summary: A.Summary,
TrainingPaymentMethod: A.'Training Payment Method'.Name,
TrainingType: A.TrainingType.Name,
VatInvoice: A.'VAT Invoice',
YearStartDate: A.'Year Start Date',
Trainees: Concat(
A.Trainees,
'First Name' & ", "
)
}
)
);
//i use this function on a Gallery which return me all the Trainees attending the selected Training on a "Details page"
/*LookUp(
Trainings,
And(
ThisRecord.Name = varSelectedTraining.Name,
ThisRecord.'Created On' = varSelectedTraining.'Created On'
)
).Trainees*/
On the codes you can find at the bottom a function i use to receive all Trainees from a Training.
How can i make this work? I would expect that "A.Trainees" would work as it is related but it gives the erorr: "Column is not accesible in this context".
Best Regards,
Anthony

Report
All responses (
Answers (