web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Separate date and time

(0) ShareShare
ReportReport
Posted on by 225

I need the date of the actualend-field from the activity-entity. But the field saves time and date and I can't chance the settings to only date. I'm going to usw them in a flow. Is there a way to seperate them?    

I have the same question (0)
  • Suggested answer
    ashish12 Profile Picture
    3,079 on at

    Change the field type to Data only than Date and Time.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    You can add a separated field and extract pure data into it using JS (like this - www.w3schools.com/.../jsref_getdate.asp) or plugin and use other field in your flow afterwards.

  • Suggested answer
    ba365guy Profile Picture
    2,950 on at

    Hi Ar0x

    I am afraid making changes to out of the box "activity" entity is not supported. 

    System doesn't allow you add / modify the fields in this entity. 

    You might choose to do changes (using new field / JavaScript) in "Task" entity (if it supports your requirement). 

    pastedimage1576256743890v1.png

    pastedimage1576256760268v2.png

  • Verified answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    As ba365guy said that we could not change the type of field since it has been published. I suggest that you could create another text field and use js code to get the date from actualedn-field and set it as a value to your new field.

    function onLoadDate(executionContext){
        var formContext = executionContext.getFormContext();
        var date1=formContext.getAttribute("new_dataandtime").getValue();
        if(date1!=null&&date1!=undefined){
            var time1=new Date(date1);
            var year=time1.getFullYear();
            var month=time1.getMonth()+1;
            var day=time1.getDate();
            var date2=year+"-"+month+"-"+day;
            var time2=new Date(date2);
            formContext.getAttribute("new_dateonly").setValue(time2);
        }
        
    }

    Hope it helps.

    Best Regards,

    Leo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 73 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

#3
Scott Jackson UK Profile Picture

Scott Jackson UK 22

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans