Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

how to get the list value of a [object array]?

(0) ShareShare
ReportReport
Posted on by 220

i've used JS on my project.

i have a result like this

myResult

[object array]                     [Object {...}, Object {...}, Object {...}]

0                                        [object Object] {...}

1                                         [object Object] {...}

2                                         [object Object] {...}

length                               3

and my goal is i want to get the list of sentOn on each onject in result. in order to get the 1 result i need to do something like this. myResult[0].sentOn. does anyone who knows this process? i not good in JS

Thank you so much for the help.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to get the list value of a [object array]?

    No problem at all. Do let me know if you have any other queries.

    Thanks,

    Jay

  • KaeL Profile Picture
    KaeL 220 on at
    RE: how to get the list value of a [object array]?

    thanks for the help. its working now. just forget the first reply

  • KaeL Profile Picture
    KaeL 220 on at
    RE: how to get the list value of a [object array]?

    0476870.Capture.PNG

    this is the code i have and i want to get all of the SentOn on each object. and i got only is 1 data. thanks for the help

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to get the list value of a [object array]?

    Hi KaeL,

    The question is not clear in terms of an example. But still from what I understand for your question this is absolutely doable by using forEach. Look at the following example code (Changes needs to be done based on your requirment)

    var a = [];

    myResult.forEach(function(obj){

       a.push(obj.sentOn);

    })

    If you would like to debug it then use console.log(a);

    If you are looking for more information on forEach for Object Array then follow the below link:

    www.codexpedia.com/.../javascript-loop-through-array-and-object-properties

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,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans