Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • 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
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • 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
    • Marketplace
    • Advertise With Us
    • 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, 2 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

    application solution

    Popular Salesforce Blogs

    Highly Effective Strategies To Make Salesforce Customization Work For You

    Blog in Salesforce customization

    There is nothing more thrilling than running your business on your terms. Thanks to Salesforce customization options, making it easier for admins to simplify the…

    Attract more Customers, Business, Business Challenges, Business Models, Certifications
    Ariztech Jun 23, 2021
    3,313  Views
    Salesforce Administrator

    What Does Salesforce Administrator Mean in 2023?

    Blog in Salesforce Admin, Salesforce Certifications

    A Salesforce administrator is a professional who is responsible for managing and maintaining a Salesforce implementation. They are responsible for the configuration, customizations, and upkeep…

    Certified Salesforce Experts, Configuration, Configure, CPQ Specialist, Customizations
    Ravikant Dec 8, 2022
    3,389  Views

    Salesforce Marketing Cloud Benefits in 2024

    Blog in Others

    Contents Why choose the Salesforce Marketing Cloud? Key Benefits of Salesforce Marketing Cloud Personalization Multi-Channel Marketing Marketing Automation Data-Driven Insights Audience Segmentation Lead Management Scalability…

    Audience Segmentation, Automation, Automation Capabilities, Data-driven Insights, Data-Informed Decisions
    Kizzy Consulting Mar 21, 2024
    1,728  Views

    Popular Salesforce Videos

    Apex Design Patterns : The Singleton Pattern in Salesforce || #Salesforce #DesignPatterns

    Apex Design Patterns : The Singleton Pattern in Salesforce || #Salesforce #DesignPatterns

    Video in Salesforce Development

    The Singleton Pattern One Private variable of the class itself will hold the instance of the complete class so that we can access all the…

    salesforce, CRM, Apex, Training, Tutorial
    SFDC Sep 5, 2025
    263  Views
    Embedding Salesforce Einstein Predictions in Tableau with Tomasz Bacewicz

    Embedding Salesforce Einstein Predictions in Tableau with Tomasz Bacewicz

    Video in Salesforce Einstein

    Get the most out of Salesforce Einstein Discovery and Tableau by embedding Predictions directly in your Dashboards! Learn how from a pro. Watch this video…

    Salesforce Training, Salesforce Einstein, Salesforce Einstein Discovery, Salesforce Video, Tableau
    Abhishek Sep 3, 2020
    1,920  Views
    Security in Salesforce | Learn About the Security Levels in Salesforce

    Security in Salesforce | Learn About the Security Levels in Salesforce

    Video in Salesforce Security

    This "???????? ?? ??????????" video by Edureka will help you understand the different levels of security in Salesforce. It will also talk about some of…

    Salesforce Training, Salesforce Tutorial, Salesforce Security, salesforce, Salesforce Video
    Prafull Jul 5, 2022
    1,613  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®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.