Toggle Side Panel

  • Blogs
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How to get a list of Sobjects in Javascript from the controller in salesforce?

    Tagged: Account, JS Controller, List, Salesforce Visualforce Page

    • Salesforce® Discussions

      How to get a list of Sobjects in Javascript from the controller in salesforce?

      Posted by Kumar on January 30, 2017 at 12:00 PM

      Hi all,

      I have list of accounts in my controller for a visualforce page. I want to directly use this list in my javascript on my page.

      How can I do this?

      Thanks

      sushant replied 9 years, 7 months ago 2 Members · 1 Reply
      • Account
      • JS Controller
      • List
      • Salesforce Visualforce Page
    • 1 Reply
    • sushant

      Member
      January 30, 2017 at 2:42 PM

      Hi Kumar,

      You can try the following code:

      <script>
      var jsAccounts= new Array();
      <apex:repeat value="{!accns}" var="accn">
      jsAccounts.push(accn);
      </apex:repeat>
      </script>

      Then your jsAccounts array will have the account values. Now you can just loop through the array and access the field. Just try console.log(jsAccounts) to see the content of the account array. Then you will understand who you should retrieve the values

      Thanks

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    Popular Salesforce Blogs

    Comparing Titans: Magento vs Salesforce Commerce Cloud Face-Off

    Blog in Others

    The first step towards the dynamic world of e-commerce starts with having a platform that can streamline everything from ordering to final delivery and customer…

    Best eCommerce Platform, CMS, Competition, Competitive Advantages, Customer Relationship Management
    Algoworks Jul 10, 2023
    1,612  Views
    Learn Salesforce Einstein – Chapter 4 (How to check API Usage)

    Learn Salesforce Einstein – Chapter 4 (How to check API Usage)

    Blog in AI and ML, Salesforce Einstein

    How to check API Usage You can see this page if you have uploaded the key using these steps. You see below sections here: 1. API…

    Learn Einstein, Salesforce Einstein, Salesforce Einstein Language
    0to1Code.Com Sep 14, 2017
    5,180  Views
    SMS In Salesforce

    3 Best SMS API Providers Other Than Twilio For SMS In Salesforce

    Blog in Others, Salesforce

    Every business strives for quick and scalable communication within a few minutes. And this is obviously not possible with calls and emails. This is why…

    AppExcahge, Automate Interactions, Automated Interactions, Best SMS API, Bulk Messaging
    360 SMS APP Jun 28, 2021
    4,955  Views

    Popular Salesforce Videos

    New Product: RepBlaze on Salesforce AppExchange

    New Product: RepBlaze on Salesforce AppExchange

    Video in AppExchange

    Visit on AppExchange: Click Here As a Sales manager, if you deal with 1000’s of inbound and other leads everyday and would love to automate…

    Salesforce Products, salesforce, Sales Productivity, Lead distribution, AppExchange
    BLUE FLAME LABS PRIVATE LIMITED Jul 30, 2018
    2,056  Views
    Salesforce Trailhead Bootcamp - Fast Track your Salesforce Certification - $700 OFF LIMITED TIME

    Salesforce Trailhead Bootcamp - Fast Track your Salesforce Certification - $700 OFF LIMITED TIME

    Video in Salesforce Certifications, Salesforce Training

    If want to fast track the path to your Salesforce Administrator Certification then this video is for you! This offer includes your $200 Certification Voucher…

    Salesforce Certification, Salesforce Administrator, salesforce, Salesforce Trailhead, Salesforce Admin
    Bradley May 14, 2020
    7,154  Views
    Salesforce For Beginners - Create Lookup , Master-Detail Relationship and Rollup Summary

    Salesforce For Beginners - Create Lookup , Master-Detail Relationship and Rollup Summary

    Video in Salesforce Admin

    Salesforce Administration tutorial which demonstrates how to create Lookup Relationship, Master-Detail Relationship and Rollups . Things to be learned from the video : How to…

    Salesforce Administration, Salesforce Administrator Training, Salesforce Beginner Tutorial, Easy Way To Learn Salesforce, Salesforce Custom Objects
    Pooja Dec 14, 2018
    2,113  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.