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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

How to populate Date field from another Entity's date field in javascript ?

(0) ShareShare
ReportReport
Posted on by

i did a switch case code to get an attribute type and do something for each type; but when i try to get attribute type of a date it syas that it doesnt exist

how do i get the date type to know how to enter the right case in the switch ?

fieldType = Xrm.Page.getAttribute(fieldDestination[index]).getAttributeType();
                        switch (fieldType) 
                        {
                            case "lookup":
                                do something
                                break;
                            case "string":
                                do something
                                break;
                            case "optionset":
                                do something
                                break;
                            case "": // what should be here for date type? how to get the date AttributeType to know how to get here in this case?
                                do something
                                break;
                            default:
                                console.log(fieldType   "Unkown");
                                break;
                        }

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Partner,

    You need use 'datetime' to get attribute type of a date.

    getAttributeType (Client API reference) - Power Apps | Microsoft Docs

    pastedimage1634194375713v1.png

    Test:

    pastedimage1634194442427v2.png

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 55

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans