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 :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
Posted on by 224

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

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

    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

  • KaeL Profile Picture
    224 on at

    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

  • KaeL Profile Picture
    224 on at

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

  • Community Member Profile Picture
    on at

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

    Thanks,

    Jay

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans