{"id":14453,"date":"2019-02-08T11:53:39","date_gmt":"2019-02-08T11:53:39","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=14453"},"modified":"2019-02-08T11:53:39","modified_gmt":"2019-02-08T11:53:39","slug":"set-date-time-field-dynamics365-power-app","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/02\/set-date-time-field-dynamics365-power-app\/","title":{"rendered":"Set Date and Time Field of Dynamics 365 in PowerApps"},"content":{"rendered":"<h2><strong>Introduction<\/strong><\/h2>\n<p>Power App helps you to create a quick mobile app to show details of your CRM organization. In today\u2019s blog, we will explore more on how to set Date and Time field of Dynamics365 in Power App.<\/p>\n<p>Following are the steps to set Date and Time fields of Dynamics 365 in Power Apps:<\/p>\n<p><strong>1<\/strong>. Create a default Canvas app for appointment entity by using Dynamics 365. You can refer our previous blog <a href=\"https:\/\/www.inogic.com\/blog\/2018\/07\/create-records-in-dynamics-365-with-canvas-powerapp\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p><strong>2<\/strong>. As you know appointment entity contains two date and time fields i.e. \u201c<strong>Start Time<\/strong>\u201d and \u201c<strong>End Time<\/strong>\u201d as shown in below screenshot:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14454\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/1Dynamics365-Power-App.png\" alt=\"Dynamics365 Power App\" width=\"925\" height=\"618\" \/><\/p>\n<p>Let\u2019s set the value of \u201c<strong>Start Time<\/strong>\u201d and \u201c<strong>End Time<\/strong>\u201d through Power App.<\/p>\n<p><strong>3<\/strong>. Now in \u201c<strong>Edit screen<\/strong>\u201d in power app you can see the \u201c<strong>Start Time<\/strong>\u201d and \u201c<strong>End time<\/strong>\u201d fields with \u201cdate and time\u201d data type as shown in below screenshot:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14455\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/2Dynamics365-Power-App.png\" alt=\"Dynamics365 Power App\" width=\"1048\" height=\"752\" \/><\/p>\n<p><strong>4<\/strong>.\u00a0Now on \u201c<strong>onSelect<\/strong>\u201d property of \u201c<strong>IconAccept<\/strong>\u201d \u00a0add patch formula as given below:<\/p>\n<p>Patch(<\/p>\n<p>Appointments,<\/p>\n<p>First(<\/p>\n<p>Filter(<\/p>\n<p>Appointments,<\/p>\n<p>activityid = BrowseGallery1.Selected.activityid<\/p>\n<p>)<\/p>\n<p>),<\/p>\n<p>{<\/p>\n<p>scheduledstart:\u00a0 If(<\/p>\n<p>IsBlank(DateValue1.SelectedDate),<\/p>\n<p>Blank(),<\/p>\n<p>DateValue1.SelectedDate + Time(<\/p>\n<p>Value(HourValue1.Selected.Value),<\/p>\n<p>Value(MinuteValue1.Selected.Value),<\/p>\n<p>0<\/p>\n<p>)<\/p>\n<p>) ,<\/p>\n<p>scheduledend:\u00a0 If(<\/p>\n<p>IsBlank(DateValue2.SelectedDate),<\/p>\n<p>Blank(),<\/p>\n<p>DateValue2.SelectedDate + Time(<\/p>\n<p>Value(HourValue2.Selected.Value),<\/p>\n<p>Value(MinuteValue2.Selected.Value),<\/p>\n<p>0<\/p>\n<p>)<\/p>\n<p>)<\/p>\n<p>}<\/p>\n<p>)<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14456\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/3Dynamics365-Power-App.png\" alt=\"Dynamics365 Power App\" width=\"1169\" height=\"790\" \/><\/p>\n<p><strong>5<\/strong>.\u00a0Let\u2019s run the app and set \u201c<strong>Start Time<\/strong>\u201d and \u201c<strong>End Time<\/strong>\u201d for a record in CRM through Power App by selecting<\/p>\n<p><img decoding=\"async\" class=\"wp-image-14460 alignleft\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/p.png\" alt=\"\" width=\"15\" height=\"15\" \/>in power App.<\/p>\n<p style=\"padding-left: 120px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-14457\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/4Dynamics365-Power-App.png\" alt=\"Dynamics365 Power App\" width=\"442\" height=\"785\" \/><\/p>\n<p>Now as shown below the \u201cStart Time\u201d and \u201cEnd Time\u201d values are updated in CRM:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-14458\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/02\/5Dynamics365-Power-App.png\" alt=\"Dynamics365 Power App\" width=\"931\" height=\"619\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>By using the simple steps we can set date and time fields of Dynamics365 in Power App.<\/p>\n<blockquote><p><em><strong>To help evaluate your business needs and design a custom app for your specific requests reach out to us at\u00a0<a href=\"mailto:crm@inogic.com\" target=\"_blank\" rel=\"noopener noreferrer\">crm@inogic.com<\/a>\u00a0| Read our blog series on <a href=\"https:\/\/www.inogic.com\/blog\/category\/dynamics-365\/microsoft-powerapps\/\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft PowerApps<\/a><\/strong><\/em><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Power App helps you to create a quick mobile app to show details of your CRM organization. In today\u2019s blog, we will explore more on how to set Date and Time field of Dynamics365 in Power App. Following are the steps to set Date and Time fields of Dynamics 365 in Power Apps: 1.\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/02\/set-date-time-field-dynamics365-power-app\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":14459,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,18,44],"tags":[571,1169,1338],"class_list":["post-14453","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-power-apps","tag-dynamics-365-power-app","tag-microsoft-power-apps","tag-power-apps-dynamics-365-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/14453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=14453"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/14453\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/14459"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=14453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=14453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=14453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}