cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnthonyDo
Helper III
Helper III

Relate Many to Many in For All

Hi,

 

I am trying to relate an extra cost to multiple trainees. You can see the Many-to-many relationship in the picture below.

 

2021-08-23 13_47_29-Power Apps.png

 

I have a form 'frmAddExtraCostAddTraining'.

I have a collection 'colSelectedTraineesAddTraining' which holds all the trainees i want to relate to.

I have a button on select: 

 

 

ForAll(
    colSelectedTraineesAddTraining,
    Relate(
        frmAddExtraCostAddTraining.LastSubmit.cref8_ExtraCost_cref8_Trainee_cref8_Train,
        ThisRecord
    )
);

 

 

I have a gallery which has all the trainees in it. It has a label in the gallery with the following code:

 

 

Text(
    varTrainingPrice + Sum(
            ThisItem.'Extra Costs'
        ,
        If(
            cref8_vatinvoice = 'VAT Invoice (Extra Costs)'.'1',
            cref8_pricevatexcluded,
            cref8_price
        )
    ),
    "###,###,##0.00"
)

 

 

 

When i add an extra cost the gallery label 'cost' doesn't change so i don't think the relate function works. Anyone knows how to do this?

 

Greetings,

 

Anthony

 

0 REPLIES 0

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (2,123)