web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Toggle switch with rel...
Power Apps
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! 🤗
I have the same question (0)
  • Erica5 Profile Picture
    23 on at

    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard