[TIPS] Hide date format "12/31/2001" when date filed is unselected or blank in Canvas App

 Issue: 

  In Power Apps (Canvas App), when use SharePoint as the data source, the date field always shows "12/31/2001" even this field is blank or not selected.


Solution:

step 1:  Add a Text Lable lbl_CloseDate  to Close Date datacard under existing date field fld_CloseDate


Step 2:  Change the text lable's Text property to fld_CloseDate.SelectedDate


Step 3:  Change text lable Y property to be the same with existing date field.
             Change the close date Datacard height to normal (e.g. 50).




Step 4:  Change text lable Visible property to: 

If(fm_Req_Main.Mode = FormMode.View && IsBlank(fld_CloseDate.SelectedDate), true,false)


Step 5: Change date pick field Visible property to :  Not(lbl_CloseDate.Visible)



Done.



No comments:

Post a Comment