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 can I fetch the list views columns in Salesforce?

    Tagged: List View, List View Column, Metadata API, Salesforce Apex, Salesforce SOQL

    • Salesforce® Discussions

      How can I fetch the list views columns in Salesforce?

      Posted by Naman on April 30, 2016 at 6:07 PM

      I want to fetch the list views columns in salesforce. Please tell how to do this.

      Ajay Prakash replied 7 years, 10 months ago 3 Members · 2 Replies
      • List View
      • List View Column
      • Metadata API
      • Salesforce Apex
      • Salesforce SOQL
    • 2 Replies
    • Surbhi

      Member
      June 9, 2016 at 1:16 PM

      Hi Naman,

      This can be done using Metadata API.

      Thanks

    • Ajay Prakash

      Member
      February 12, 2018 at 2:34 PM

      We can retrieve list view column or the records based on the list view id using HTTP request. The response contains the query string that contains columns of the list view.  Below code is for reference –

      public static List<Account> getFilteredAccounts(String filterId){
          HttpRequest req = new HttpRequest();
          String baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
          String endPoinURL = baseUrl+’/services/data/v32.0/sobjects/Account/listviews/’+filterId+’/describe’;
          req.setEndpoint(endPoinURL);
          req.setMethod(‘GET’);
          req.setHeader(‘Authorization’, ‘Bearer ‘ + UserInfo.getSessionId());
          Http http = new Http();
          HTTPResponse response = http.send(req);
          Map<String, Object> tokenResponse = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
          String query = (String) tokenResponse.get(‘query’);
          List<Account> AccountList = new List<Account>();
          for(Account accountObj : database.query(query)){
              AccountList.add(accountObj);
          }
          return AccountList;
      }

      In the above example, I have retrieved accounts based on the selected list view.

    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 Implementation

    Salesforce Implementation Checklist: 9 Steps to Success

    Blog in Salesforce Implementation

    Through it all, Salesforce continues to remain one of the largest players and one of the best platforms in the market. But we all know…

    Best Implementation, Best Salesforce Implementation, Business, Business Needs, Company
    DB Nov 16, 2021
    4,584  Views
    classic vs lightning

    Salesforce Lightning Experience Vs. The Classic UI

    Blog in Lightning, Salesforce

    With the better versions coming every quarter in Salesforce, we all are aware of the debate about the Salesforce Lightning experience versus the Salesforce Classic…

    Coding World, Einstein Analytics, Einstein Wave Analytics, Lightning, Lightning Experience
    Anjali May 22, 2020
    4,449  Views

    What is Salesforce CPQ and How Does Salesforce Work?

    Blog in Salesforce Products

    The sales representatives have a variety of tasks at hand and better management of these tasks results in more productivity. These tasks primarily include preparing…

    Application, Automation, Business Needs, Configuration of Products, Configure
    SP Aug 5, 2021
    4,093  Views

    Popular Salesforce Videos

    Things You Should Know Before Starting Salesforce Consultancy?

    Things You Should Know Before Starting Salesforce Consultancy?

    Video in Salesforce Consultant

    Following are the things you should know before starting the Salesforce Consultancy: 1. Do the Marketing Research 2. Focus on USP The rest of the…

    Salesforce Training, Salesforce Tutorial, salesforce, Salesforce Consulting, salesforce consultants
    S2 May 6, 2022
    1,583  Views
    Florida DataTribe EA Virtual Salesforce Saturdays

    Florida DataTribe EA Virtual Salesforce Saturdays

    Video in Salesforce Stories

    Learn to teach so you can learn by teaching. The how why and when of the Florida DataTribe and their Einstein Virtual Salesforce Saturdays. Enjoy…

    Salesforce Training, salesforce, Salesforce Video, Salesforce Learning, Salesforce information
    Nauman Aug 17, 2020
    1,348  Views
    Salesforce Field Service Basics | Salesforce Webinar

    Salesforce Field Service Basics | Salesforce Webinar

    Video in Salesforce Field Service Platform

    Salesforce Field Service is a cloud-based platform that enables businesses to manage and automate their customer service operations. From customer contact management, and call routing…

    Salesforce Field Service Platform, Salesforce Field Service, Field Service Management, Field Service, Field Service Mobile App
    AblyPro Jul 1, 2024
    486  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

    © 2025 - 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.