Hi,
I have Form in my Power App linked to a Sharepoint Laptop Loan list. It has a return date which sets off a power automate script to send the user a return device email. My issue is that on the EditForm the date field can’t seem to be set to blank (which is important so the Power Automate script doesn’t think the device is out on loan). I’ve tried to use a separate button to update the field using Blank(DataCard13_1) but it sets the date to 31st Jan. The cards default value is the item in the spreadsheet.
Thanks.
@Specthildur - The UpdateContext function declares a Context Variable which is scoped to the current screen. Given the Edit Form is on a different screen, the UpdateContext would not work here.
It is possible to use a Global Variable which is scoped to the entire app, or parse the Context Variable over to the other screen.
For the latter, on the OnSelect property of your Gallery, or on the OnSelect property of whatever Icon/Control you're using to Navigate to the Form Screen, use the following syntax:
Navigate(
'Your Edit Form Screen',
ScreenTransition.None,
{ctx_reset: false}
);
EditForm('Your Form')
Hi @Amik
Thank you, this did the trick and now I can reset the date successfully! However there is one slight issue still. When editing a selection the date shows as blank and not what the default parent date should be, any suggestions? Although it shows blank, on my viewing screen the date does appear there, just seems like it's blanking it by default when editing that item. I have 3 screens, a Gallery view screen, a view form for a selected gallery item and an edit form for that item.
I did make sure to use 'UpdateContext({ctx_reset: false})' on my 'edit' button on the item. Attached screenshots of what shows on the 'view' screen and then what appears on the 'edit' screen. View screen uses a Mordern Form as well, but the edit button is just a navigation button to the edit form screen.
@Specthildur - for the Modern Date control use the SelectedDate property.
Regarding this section:
UpdateContext({ctx_reset: false});
UpdateContext({ctx_reset: true});
UpdateContext({ctx_reset_date: ""});
Reset('Your Date Picker')
This belongs on the OnSelect property of the Button control, not on the Date Control.
Hi @Amik
Thank you for your response. I'm new to powerapps so apologies in advance for any mistakes.
Just following through with your guidance, your first two basic steps worked great, except it wouldn't show the gallery date and would reset it regardless even if an entry had an expected date. If I edited a form inputed a date, then it would reset again.
I then tried following the next bit of guidance but the Modern Date Picker doesn't have a 'DefaultDate' or 'OnSelect' options unfortunately. I did try and use 'SelectedDate' for 'DefaultDate' but when entering
UpdateContext({ctx_reset: false});
UpdateContext({ctx_reset: true});
UpdateContext({ctx_reset_date: ""});
Reset(DataCardKey13_1)
It says that it expects DataCardKey13_1 (My Expected Return Date Picker) to have a 'resettable control as its input'
Any suggestions appreciated.
Basic example:
Add a Button or an Icon control into your App. On the OnSelect property of that control, enter:
UpdateContext({ctx_reset_date: ""});
Reset('Your DatePicker')
On the DefaultDate property of the Date Picker control, enter:
ctx_reset_date
For a Date Control embedded into an Edit Form control, I would approach it this way:
Add a Button or Icon into the one of the Data Cards (most logically I would place the control inside the Data Card which holds the Date Picker control).
On the OnSelect property of the Button, enter:
UpdateContext({ctx_reset: false});
UpdateContext({ctx_reset: true});
UpdateContext({ctx_reset_date: ""});
Reset('Your Date Picker')
On the DefaultDate property of the Date Picker control, enter:
If(
ctx_reset,
ctx_reset_date,
Parent.Default
)
Depending on how you're populating the Item property of the Edit Form (for example via a Gallery selection), ensure you set the context variable to false on the OnSelect property of the Gallery using:
UpdateContext({ctx_reset: false});
MS.Ragavendar
20
BCBuizer
10
Super User 2025 Season 1
LC-26081402-0
10