Set Datetime picker value on Microsoft Power-app Portal form

Set Datetime picker value on Microsoft Power-app Portal form

To set the value in Date time picker field, we need to convert the particular format.

Take an example, we have simple date value

var todayDate = new Date();

Use below code to set the date value, since dynamics supports standard UTC format for date.

$("logicalName").val(moment.utc(todayDate).format(‘YYYY-MM-DDTHH:mm:ss.0000000\\Z’));

It  uses momentjs file, it comes build in with powerapp portal. The above code will set the value in date field but to display the value, we need to set in description. You can set different format to display the value in description.

     $("logicalName_datepicker_description").val(moment.utc(todayDate).format(‘YYYY-MM-DDT’));

 

 

No comments:

Post a Comment

Write us your comment.

Featured Posts

Download CRM 365 V9.X Tools using PowerShell

This configuration explains about how to download D365 utility tools step by steps. Step1 : Create a folder in your particular drive where y...

Popular Posts

Contact Me

Name

Email *

Message *