I have created an app to hold our applications in, and can record our interview data with. I have then created a button which when pressed emails selected data from the application / interview to the enrolment team. That works. However I want the button to also add the current date into a date picker to so it shows when the button was pushed so people know it was sent to the enrolment team.
This is my current situation:
The Enrol Learner button is on a data card set within the form.
The existing code in the OnSelect for the button is
"email address@email address.com",
" New Enrolment " & ThisItem.'Course to Enrol Onto 21/22'.Value,
"<font size=12>Programme Offer Form</font><br>" & "<br>" & "<font size=4><b>Learner Name: </b>" & ThisItem.Name & "<br>" & "<br><b>TERMS ID: </b>" & ThisItem.'TERMS Learner Code' & "<br>" & "<br><b>Course to Enrol Onto: </b>" & ThisItem.'Course to Enrol Onto 21/22'.Value & "<br>" & "<br><b>Start Date: </b>" & ThisItem.'Start Date' & "<br>" & "<br><b>Planned End Date: </b>" & ThisItem.'Planned End Date' & "<br>" & "<br><b>Initial Assessment Level: </b>" & ThisItem.'Learners IA Level' & "<br>" & "<br><b>Employment Status: </b>" & ThisItem.'What is Your Employment Status'.Value & "<br>" & "<br><b>If Employed, How Many Hours a Week? </b>" & ThisItem.'If you are employed or self employed hour many hours a week do you work:'.Value & "<br>" & "<br><b>Do the earn less than £17,374? </b>" & ThisItem.'Do you earn less than £17,374 ?' & "<br>" & "<br><b>If Unemployed, ar you currently loking for work? </b>" & ThisItem.'Are you currently looking for work (if unemployed)' & "<br>" & "<br><b>Are you in receipt of any State Benefits? </b>" & ThisItem.'Are you in receipt of any state benefit?' & "<br>" & "<br><b>Benefits being Claimed: </b>" & ThisItem.'I can confirm that I receive the following benefits:' & "<br>" & "<br><b>Are you released on temporary licence, studying outside a prison enviroment, and is not funded by the Ministry of Justice? </b>" & ThisItem.'Are you released on temporary licence, studying outside a prison environment, and it is not funded by the Ministry of Justice?' & "<br>" & "<br><b>Date of Assessment: </b>" & ThisItem.'Date of Assessment Interview' & "<br>" & "<br><b>Assessment Completed by: </b>" & ThisItem.'Assessment completed by' & "<br>" & "<br><b>Proof of Photo ID seen: </b>" & ThisItem.'Proof of Photo ID seen'.Value & "<br>" & "<br><b>Additional Proof of Photo ID seen: </b>" & ThisItem.'Additional Proof of ID seen'.Value & "<br>" & "<br><b>Confirm what evidence of Residency seen: </b>" & ThisItem.'Confirm What evidence of Residency seen'.Value & "<br>" & "<br><b>Additional evidence of Residency seen: </b>" & ThisItem.'Additional evidence of Residency seen'.Value & "<br>" & "<br><b>Further evidence of Residency seen: </b>" & ThisItem.'Further evidence of Residency seen'.Value & "<br>" & "<br><b>IQA Name </b>" & ThisItem.'IQA Name'
I have looked everywhere on the internet and I cannot find anywhere how to do this - all I can find is having a button within the datacard where the date is held which I tried to adapt but all that happened was when I pressed the Enrol Learner button was gett an email saying TRUE!. The date picker in my app that would have the date added to is Date Forwarded.
Hi @davidessex ,
Try this: on the OnSelect of the button, add this before the email formula
And use that variable (DateForwarded) on the DefaultDate property of the Date picker.
Hope this help.
Hi. Sort of worked but didn't.
It changed the date in the Date Forwarded to Enrolments box to today's date when pressing the button, but unfortunately that does not save it to the Sharepoint List that the data comes from, so when you go back into that record it's back to the default blank date.
Ok, so after sending the mail, it has to submit the rest of the data to your SharePoint when clicking the button? or it has to store only the date to the SharePoint?
Why a Date Picker? A label would work very well.
On your OnSelect, add this Set( varSentOn, Now() )
On the label, in the Text property put this varSentOn
If you need to manipulate the way the date is show, use Text( varSentOn, "the format you need" ). Here's a good reference: Show text, dates, and times in canvas apps - Power Apps | Microsoft Docs
Also, understand this value won't persist. In order for it to persist ir needs to be saved to a darasource.
Yep only the date to sharepoint. It so we have an audit trail of when the enrolment email was sent to the enrolment team.
I tried adding the submitform command but again it did not like it and gave me the little red cross. The Date Forwarded data card and the date picker are both set as Edit (rest of the form is view) and the sharepoint list is set as date.
I would delete that datepicker and insert a label. Anyway, if you have the value stored in sharepoint point the DefaultDate to it YouGallery.Selected.YourDateFiled
By clicking on the button, does it submit the form to the SharePoint too? If Yes, change the datepicker as suggested by @jcfDaniel to a label and set it default value (Text) to be Now() so that by submitting the form, it pick the datetime record and submit to the SharePoint.
I changed the date picker to a text field with Edit switched on. I changed the text property to VarSentOn and added the Set ( VarSentOn, Now()); at the start of my OnSelect command, which adds the date, however i still cant use submitform to add to the List- as soon as you add it and use the form title (detailForm1) it goes red X. I have also tried it as submitform(ThisItem.Date Forwarded to Enrolments) and submitform('Date Forwarded') and this rejected it too. In addition using this method also adds the date to the next record that the previous one the button was pushed on (and if you push the button again it changes the date on all records showing again until you come out of the app when it clears the date)? I don't want a date to appear in the next record until it has been submitted.
I also tried the Now () in Text property but all it did was add the current date in the data card.
Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.
Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.
The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.
We are excited to announce a new way to share your ideas for Power Apps!