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 / Question - I have a "Y...
Power Apps
Unanswered

Question - I have a "Yes/No" data field, i need to show another field when its selected "Yes". I have used UpdateContext but this isnt working

(1) ShareShare
ReportReport
Posted on by

I have put:

UpdateContext({showDataField:true}) within the "onCheck" attribute of the "Yes/No" toggle 

 

and put:

 

showDataField within the "Visible" attribute for the data field that needs to be shown. 

 

Am i missing something? or should i be initialising the variable on onStart or using it within a different attribute? 

Categories:
I have the same question (0)
  • Sickle-Cell Profile Picture
    600 Super User 2024 Season 1 on at

    Hi @PowerNovice 

    You don't even need UpdateContext. Just set the Visible property of the field to If(DropdownName.SelectedText.Value="Yes",true,false)

  • Pro_User_365 Profile Picture
    546 on at

    Hi @PowerNovice ,

    To show another field based on the selection of a "Yes/No" toggle in Power Apps, using UpdateContext is a correct approach. However, ensure the following steps are correctly implemented:

    1. Initialize the Variable: On the OnStart of the app or screen, initialize showDataField using UpdateContext({showDataField: false}). This sets the default state.

    2. Set OnCheck and OnUncheck: In the toggle control's OnCheck, use UpdateContext({showDataField: true}). Similarly, in the OnUncheck, use UpdateContext({showDataField: false}).

    3. Configure Visibility: In the Visible property of the field you want to show or hide, simply reference the variable: showDataField.

    4. Save and Refresh: After making these changes, save and then refresh your app to ensure the changes take effect.

    This approach should dynamically show/hide the field based on the state of the "Yes/No" toggle. Make sure there are no typos or syntax errors in your formula.

     

    Note: After receiving the answer, if you think it's helpful, please consider accepting it. 😊 Regards! Ali Shahzad

     
     
  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    Hey,

     

    i made a test and it worked.

     

    i inserted a Text input control and a toggle.

     

    For the Text input control i set the visible property to Toggle1.Value.

     

    this shows my text input only when the toggle has the value "on".

     

     

    please let me know if it helped and accept as solution if it did to help others 🙂

     

    mmbr1606_0-1701186101638.png

     

  • Verified answer
    PowerNovice Profile Picture
    on at

    Hi, 

     

    Your reply got me thinking so i thank you. There is no attribute for "SelectedText" so i simply just checked the boolean value and checked whether it was true or false - true = yes / false = no. 

     

    Below is the solution.

    If(DataCardValue63.Value = true, true,false)

  • PowerNovice Profile Picture
    on at

    Hi @mmbr1606 , 

     

    appreciate the reply, i have now resolved the problem. That is a nice and easy way to do it.  

  • PowerNovice Profile Picture
    on at

    Hi @Pro_User_365 , 

     

    Yeh i continued to try that, but it wasnt working for me. So i did the below instead, and this works for what i need. Something simple. Thank you for your help and explanation. 

     

    If(DataCardValue63.Value = true, true,false)

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard