How to show Date Picker Values in Edit Form

Loading

Requirement: The Process to display a Date Picker Values in Edit Form.

  • User need to Show the time of the event that you have opened in the edit mode. when you open that event in edit mode it should still show the event when it is added.

 Initially create a Sharepoint list “ Leave” to connect with power apps

  • Create app add Label, rectangle and button
  • Also add Edit form to connect data
DefaultDate for Date Picker:
If(EventForm.Mode=FormMode.Edit, ThisItem.'Start Date', Now())
Default for Hourvalue:
If(
  EventForm.Mode=FormMode.Edit, 
  If(
    Mod(Hour(ThisItem.'Start Date'),12) = 0, 
    "12", 
    Text(Mod(Hour(ThisItem.'Start Date'),12),"[$-hi-IN]00")
  ),
  If(Mod(Hour(Now()),12) = 0, 
    "12", 
    Text(Mod(Hour(Now()),12),"[$-hi-IN]00")
  )
)

Default for Minutevalue8:

If(
  EventForm.Mode=FormMode.Edit, 
  Text(Minute(ThisItem.'Start Date'), "[$-hi-IN]00"), 
  Text(Minute(Now()), "[$-hi-IN]00")
)
Default for AM_PMDD_1:
If(
  EventForm.Mode=FormMode.Edit, 
  If(Hour(ThisItem.'Start Date') < 12, "AM", "PM" ), 
  If(Hour(Now()) < 12, "AM", "PM" ) 
)

Now Run the application to enter the details and save the form using Save Button

Save= Onselect Property- SubmitForm(EventForm);ResetForm(EventForm)

After Saving go back to the SP list and the check the recently added item, it displays date, time, am or pm.

Leave a Reply

Your email address will not be published. Required fields are marked *