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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Toggle Status based on...
Power Apps
Answered

Toggle Status based on Multiple Conditions

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am currently using the below to initiate the default setting of a Toggle control that indicates whether a Member is 'Active' or 'Inactive' based on a query/filter of a List.

 

If(Gallery.Selected.Mem="Yes",true,false)

 

The same action in reverse; if the Toggle is moved from its default position there is a Patch that updates the item in the List to the new status.

 

Inputs:

1. SP List (or Collection) of Member's and their training

2. Columns (Title, Status)

 

Desire:

1. At AppStart initiate a sequence that Clear Collects Member current Status "Active" or "Inactive", as designated by the position of the 'Toggle'

2. Member current status should be determined by the formula querying the "Compliance Status" (per the ComplianceStatus column on in the List), of each of the following four Titles: Fitness, SCBA, Live Fire, Medical).

3. If any of the 'ComplianceStatus' of the 'Titles' is "Noncompliant" the Members 'Status' shall automatically be triggered to "Inactive" by the formula.

4. The Member's staff shall remain "Inactive" until all four qualifications show "Compliant". 

5. Though manual manipulation of the Status Toggle is allowed for various reason, if the Member is "Noncompliant" the Toggle shall not be changeable. 

 

Wheew! Any help?

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you add the Toggle control inside a Gallery control?

    Could you please share a bit more about the "Compliance Status" column? Is it a Choice type column with "Noncompliant" and "Compliant" value?

    Could you please show more details about the data structure of your SP List?

     

    I suppose that you create a "Compliance Status" column for each Title in your SP List, is it right? If you add the Toggle control inside the Gallery, please try the following workaround:

    Set the Default property of the Toggle control to following:

    If(
     ComplianceStatus_Fitness.Value = "Noncompliant" || ComplianceStatus_SCBA.Value = "Noncompliant" || ComplianceStatus_LiveFire.Value = "Noncompliant" || ComplianceStatus_Medical.Value = "Noncompliant",
     false,
     true
    )

    Set the FalseText property of the Toggle control to following:

    "Inactive"

    Set the TrueText property of the Toggle control to following:

    "Active"

    Note: The ComplianceStatus_Fitness, ComplianceStatus_SCBA, ComplianceStatus_LiveFire and ComplianceStatus_Medical represents the Choice type columns in your SP List to store the "Compliance Status" values.

     

    Please try above solution, then check if the issue is solved.

     

    Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    There is a Member list, Member Training list, Site list.

     

    Each Member list has several columns, including Title (cert/qual) column, Member Status (active/inactive), Compliance Status (compliant/noncompliant/certified - based on type of cert/qual in Title column).

     

    The screen has a freestanding Member Name Dropdown (from Member List)

     

    The screen has a freestanding Member Operational Status Toggle (from Member List)

     

    Gallery 1 (from Member list) displays Member field (Yes/No), Member Active field (Yes/No)

     

    Gallery 2 (from Site list) displays data including whether Site is a 'Company' Site.

     

    Gallery 3 (from Member Training list) displays several columns including Compliance Status. The Gallery fields are made up of HTML text fields (to manage color needs based on content).

     

    Toggle Functionality Desired:

    1. Toggle shall not be visible if DD is blank AND Gallery 2 ThisItem: Company Site (also known as field HtmlText1_117)  = "No"

     

    2. When a Member is chosen (or changed) in the DD the Toggle condition will change/or remain based on the Member Active field content in the Member List.

     

    3. The Toggle condition shall reflect the real-time Active status of each Member every time the DD changes.

     

    4. The User shall have the ability to manually override the Toggle condition from 'Active' to 'Inactive' status as necessary (for leave, re-assignment, other admin needs). I have a Patch that already overwrites the list upon change.

     

    5. The Toggle shall automatically default to 'Inactive' if/when the User changes the DD and Gallery 3 updates, if the ComplianceStatus (also an HtmlText field) of any of those items returned is "Noncompliant". I have a Patch that will overwrite the list upon change.

     

    6. The User shall not be able to 'manually' change the Toggle from 'Inactive' to 'Active' if the ComplianceStatus of any of the Titles is 'Noncompliant'. However, upon upload and update of Titles and each updates to 'Compliant' the Toggle shall default to 'Active'. 

     

     

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    # 1, please set the Visible property of the Toggle control to following:

    If(
     IsBlank(MemberNameDropdownBox.Selected.Result) && Gallery2.Selected.'Company Site' = "No",
     false,
     true
    )

    Note: I assume that the 'Member Name' field is a Text type field in your SP List. The Items property of the Member Dropdown box is set to following:

    Distinct('Member list', 'Member Name')

     

    # 2, #3, please set the Default property of the Toggle control to following:

    If(
     LookUp('Member List', 'Member Name' = MemberNameDropdownBox.Selected.Result, 'Member Active') = true,
     true,
     false
    ) 

     

    # 4, please set the OnCheck property of the Toggle control to following:

    Patch(
     'Member List',
     LookUp('Member List', 'Member Name' = MemberNameDropdownBox.Selected.Result),
     {
     'Member Active': true
     }
    )

    set the OnUncheck property of the Toggle control to following:

    Patch(
     'Member List',
     LookUp('Member List', 'Member Name' = MemberNameDropdownBox.Selected.Result),
     {
     'Member Active': false
     }
    )

     

    # 5 ,  you should add proper detect condition into the Default property of the Toggle control based on the ComplianceStatus column value.

     

    # 6, you should disable or not disable the Toggle control based on whether the ComplianceStatus of any of the Titles is 'Noncompliant'. You should apply proper detect condition to the DisplayMode property of the Toggle control.

     

    Hopes above explanation would help in your scenario.

     

    Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    One issue; now when the Toggle is changed, by formula or User, from 'Active' to 'Inactive' it clears out the DD, and by consequence the two of the Galleries filtered by the DD go blank. 

    A change to the Toggle should only update the member status on the Member List without resetting/clearing out the DD or Galleries.

     

    Toggle Default: If(Gallery1.Selected.ActvMem = "Yes", true,false)

     

    Toggle OnCheck:

    Patch(List, LookUp(List,FullNm=MmbrFullNmDD.Selected.FullNm),
    {
    ActvMem: "Yes"
    }
    )

     

    Toggle OnSelect: (No content entered)

     

    Toggle OnUncheck:

    Patch(List, LookUp(List,FullNm=MmbrFullNmDD.Selected.FullNm),
    {
    ActvMem: "No"
    }
    )

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard