Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Question on formatting related to data.d on ODATA Rest array return

(0) ShareShare
ReportReport
Posted on by 1,583

I have an ODATA Rest endpoint query function that gets the data I need.

My problem is that I am having difficulty getting the desired data out of data.d and displaying it in an alert.

The problem code snippet to focus on is shown below:

var result_data = data.d;
alert(result_data.results[0]);

In the Visual Studio debugger, look specifically on right portion of the screen, what looks like:

  • data.d 
  • array element [0] 
  • property new_s_bingolicensetypeId

As someone new to development and CRM, I am certain my problem is one of syntax. I am hoping someone can show me how to write alert(result_data[0]."new_s_bingolicensetypeId") so my alert actually returns 5c87c42e-af6e-e511-adaa-000c29d70c71 instead of an alert box that says "Undefined"

I have to be missing something from a syntax standpoint. Any help would be greatly appreciated. 

Screen-Shot-2015_2D00_10_2D00_17-at-4.24.08-PM.png

I also wanted to mention that if I do this:

var result_data = data.d;
alert(result_data.results[0]);

the alert box pops up "[object Object]" so I know I am close. I am so close, and just need that extra push to get up the hill. 

*This post is locked for comments

  • ACECORP Profile Picture
    ACECORP 1,583 on at
    RE: Question on formatting related to data.d on ODATA Rest array return

    That did it! Thanks so much!

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans