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 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

    Salesforce Serverless PayPal Integration in 2024

    Blog in Others

    Integrating payments into your Salesforce solution typically involves setting up both a client-side environment configured with a payment SDK and a server-side component equipped with…

    Compliance, Credit and Debit Cards, Custom Validation, Customization, Development time
    Vimera | Andersen Apr 3, 2024
    689  Views

    Everything You Need To Know About Salesforce Admin Certification Exam

    Blog in Salesforce, Salesforce Certifications

    Salesforce is a game-changer, ever-evolving, always innovating, #1 CRM platform globally. It is a huge company growing leap and bounds every year. It welcomes individuals…

    App Developer, AppExchange, Approval Process, Automation Solution, Business Process
    Apphienz Apr 12, 2022
    3,046  Views
    Salesforce Commerce Cloud

    Salesforce Commerce Cloud Explained: Pricing, Hosting, Performance, Scalability

    Blog in Salesforce Cloud Platform

    Nasdaq forecasts that 95% of purchases will be made online by 2040. Statistics also say that the global e-commerce market is expected to reach $18.89 trillion by 2027, compared to $5…

    AppExchange, B2B and B2C, B2B Commerce, Bloud-based Software, Business Needs
    Brimit Oct 31, 2022
    1,808  Views

    Popular Salesforce Videos

    How to Create Bulk Custom Fields in Salesforce using BOFC App | Salesforce | BOFC | AppExchange

    How to Create Bulk Custom Fields in Salesforce using BOFC App | Salesforce | BOFC | AppExchange

    Video in Salesforce Development

    Want to perform multiple operations? This quick video walks you through how to create mass custom fields of any type (Master Detail, Lookup, Formula, Primitive…

    Salesforce Field Objects, Salesforce Objects, Salesforce Fields, Salesforce Custom Objects, Salesforce BOFC
    Jogender Jan 12, 2020
    4,369  Views
    What Is Salesforce? | Salesforce Training - What Does Salesforce Do?

    What Is Salesforce? | Salesforce Training - What Does Salesforce Do?

    Video in Salesforce Implementation

    What is Salesforce? Salesforce is a cloud computing service as a software (SaaS) company that specializes in customer relationship management (CRM). Salesforce's services allow businesses…

    Salesforce Training, Salesforce Products, Salesforce Tutorial, Salesforce Certifications, Salesforce Administration
    Abhay Jan 3, 2018
    1,893  Views
    How to import data from Sage ERP to Salesforce - Part 1

    How to import data from Sage ERP to Salesforce - Part 1

    Video in Others, Salesforce Integration

    Greytrix offers GUMU™ integration for Salesforce with Sage ERP systems - a best-of-breed solution for organizations to enhance their customer interaction. With Salesforce and Sage…

    Salesforce Training, Salesforce Tutorial, Salesforce Integration, salesforce, Salesforce Video
    Greytrix Mar 24, 2021
    3,118  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.