Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

Toggle switch with relate and default on or off depending on relate

(0) ShareShare
ReportReport
Posted on by 23

Hi all,

 

I am a new power app builder, so still searching and googling around. I hope someone can help me, because I am stuck on this part for a while now.

 

Background information:

I have 4 tables in dataverse:

- Employees (main column = name)

- Locations (main column = location)

- Specialties (main colum = specialty)

- Functions (main column = function)

 

The table Employees has a many to  many connection with all the other 3 tables. 

 

So far so good.

But now to relate and view that part.... 

I have a blank canvas with on the left side the list of employees (in a Gallery).

Next to that i have a Gallery with all the locations, a Gallery with all the specialties and a Gallery with all the functions. All these 3 with a toggle in front of it. I want to use the toggle to relate the employee. So as example let's start with the location.

 

On the location toggle I now have at the "OnCheck": Relate(GalerieEmployees.Selected.Employees; ThisItem)

It does not work, and the error showing: the first has to link to a "to many" relationship. But making it "GalerieEmployees.Selected.Name" also doesn't work. I have no idea how...
(The OnUncheck offcourse has the Unrelate part)
 
And when I select an Employee I want to set the default toggle to true if it is related. 
 
If there is a button needed to relate and/or unrelate, that's also no issue, but I couldn't get that working either and removed it. (preferably 1 button for all 3 table relates if possible)
 
Looking forward to your help! 🤗
  • Erica5 Profile Picture
    23 on at
    Re: Toggle switch with relate and default on or off depending on relate

    Ok I got the Relate/Unrelate function working, YAY! "OnCheck": 

    Relate(GalerieEmployees.Selected.Locations; ThisItem)
     
    'just' the default on the toggle keeps me bugging....
    When I click an employee, i want to see what locations are already related and those toggles should be ON.

    I now have the "Default": If(ToggleLocation.Value = "true" ; true ; false)

    Tho that results in a circular error.

     

    So in this example: Henkje2 is related to Locatie2, and I want that toggle to be ON when his nime is active.

    Erica5_0-1709210592281.png
    And yes I am sure it is related, because:
    Erica5_1-1709210797129.png

    (Medewerker=Employee)

     

    Hoping someone can help me out!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
mmbr1606 Profile Picture

mmbr1606 15 Super User 2025 Season 1

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics