PowerApps- Show or Hide TIME component from Date Time in Model Driven Apps
Ram Prakash
5,055
Implementation Steps:
Some time Use want to Show/Hide Time Field Component based on their Requirement
To Achieve that we need to write some JavaScript to enable and disabled Component
Syntax:
formContext.getControl(arg).setShowTime(bool);
arg = Field Logical Name
bool = true/false
To Enable time Component:
function enableTimeComponent(executionContext){
var formContext = executionContext.getFormContext();
formContext.getControl("FieldLogicalName").setShowTime(true);
}
To Disable time Component:
function enableTimeComponent(executionContext){
var formContext = executionContext.getFormContext();
formContext.getControl("FieldLogicalName").setShowTime(false);
}
That's it 🙂
Comments
-
PowerApps- Show or Hide TIME component from Date Time in Model Driven Apps
Hello @DanielAmico,
Please find my link for JS (Onload/Onsave/OnChange) Event, and hope this helps. Let me know if you need any help:
https://www.youtube.com/watch?v=x8kYNCkikgs&t=14s
-
PowerApps- Show or Hide TIME component from Date Time in Model Driven Apps
Hi @rampprakash , Where do I have to put/save this script for it to work?
Thanks
*This post is locked for comments