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 / how to make a yes/no f...
Power Apps
Answered

how to make a yes/no field on an existing field

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

In the field "next appointment",

 

rdv.png

Screenshot_19.png


I'd like to have the opportunity to choose whether or not there's a next appointment.

 

  • If there is a next appointment I press Yes  ➡️ I have the possibility to choose the date as you can see at the moment.
  • If there is no next appointment I press No ➡️ a message indicating "no appointment is scheduled" is recorded.

 

thanks for your help,

Categories:
I have the same question (0)
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

    Your screenshot shows that the field is required.  You must change this to not required as the field should be blank if no appt is required.  Unlock the card containing the date field.  Add a toggle control to the card and set the properties as follows:

    FalseText: 'No future appt necessary'
    TrueText: 'Make future appt'
    OnCheck: 'UpdateContext({showappt:true})
    Visible: !showappt
    Default: false
    Select all of the controls in the card and set their Visible properties to showappt

    Set the OnVisible property of the screen to UpdateContext({showappt:false})

    Set the OnSuccess property of the form to Reset(Toggle1)

    Based on these instructions, when the screen is displayed, the toggle will show No future appt necessary. When the toggle is checked, then it will disappear and the date and time controls will become visible. Once the data in the form is saved, the toggle will reset back to No appt necessary and become visible when the screen is reopened. 

    Annotation 2020-05-16 083157.jpgAnnotation 2020-05-16 083233.jpg

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi @Drrickryp ,

     

    It works perfectly! 😀


    Thank you for your help and your time

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Drrickryp ,

    I've just noticed a small detail on the other hand once I validate the form without indicating a date.

     

    Screenshot_24.png


    The result still shows me a date by default, should I adjust the "update" or something else not ?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    You will need to change the Update property to account for a blank date.  Something like

     

    If(
     IsBlank(DateValue3.SelectedDate),
     Blank(),
     DateValue3.SelectedDate + Time(
     Value(HourValue3.Selected.Value),
     Value(MinuteValue3.Selected.Value),
     0
     )
    )

     

    Make sure you have removed the required property for the field or PowerApps will try to insert the current date and time in the field.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Drrickryp ,

     

    unfortunately the same result

    Screenshot_26.png

    Screenshot_27.png

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

    I think we are getting closer.  Rather than mess with the Edit screen, what if you controlled the visibility in the Display form based on a date only being shown if it is in the future.  I'm guessing here but what if you set the Visible property of the date item in the display screen to Date >= Today().  As an alternative, The Visible property of the card in the Display form as  DateDiff(Today(),futureApptDate)>0
    BTW, you shouldn't use "Date" as the name of a field because it is a reserved function in PowerApps and could lead to confusion.  Something like futureApptDate would be more appropriate. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Drrickryp ,

     

    It's working!

     

    a big thank you for your help and patience

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    De rien mon ami.

    smiling.gif

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

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard