Hello,
In the field "next appointment",
I'd like to have the opportunity to choose whether or not there's a next appointment.
thanks for your help,
Solved! Go to Solution.
Hi @Ryder
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.
Hi @Ryder
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.
Hi @Ryder
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.
I've just noticed a small detail on the other hand once I validate the form without indicating a date.
The result still shows me a date by default, should I adjust the "update" or something else not ?
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.
Hi @Ryder
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.
De rien mon ami.
User | Count |
---|---|
125 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
215 | |
180 | |
139 | |
97 | |
83 |