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 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 8 years, 6 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

    • [adinserter block='9']
    • 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

    Popular Salesforce Blogs

    Lead Assignment

    Lead Assignment to the User in a Round Robin fashion | Salesforce Tutorial

    Blog in Salesforce Admin

    Balance your team's workload by automatically assigning new leads to each user.  A round-robin assignment means that all new leads will be assigned the same…

    Email Template, Fields & Relationships, Layout Properties, Lead Assignment, Lead Assignment Rule
    Amit Kumar Jun 10, 2022
    4,768  Views
    Salesforce Winter '23

    Salesforce Winter '23 Flow Updates

    Blog in Salesforce Releases

    With the Winter ’23 release, there have been a host of improvements and exciting new features with Salesforce Flow, all delivered to make building Flows…

    Salesforce Flow, Salesforce Winter Release
    Stimulus Consulting Dec 28, 2022
    3,153  Views

    Salesforce LinkedIn Integration - Complete Guide

    Blog in Salesforce integration

    Salesforce is a global web-based company known for its customer relationship management (CRM) product. It also acts as a Software-as-a-Service (SaaS) provider and Platform-as-a-service (PaaS) provider…

    AppExchange, AppExchange Integration, Business Professionals, Businesses, Commerce Cloud
    AwsQuality Nov 4, 2019
    10,704  Views

    Popular Salesforce Videos

    Explain Standard Business Features of Salesforce?

    Explain Standard Business Features of Salesforce?

    Video in Salesforce Admin

    Standard business features of Salesforce are Contact Management, Opportunity Management, Lead Management, Quote Management, Sales Management and Sales Forecasting. Watch the video to learn all…

    Salesforce Training, Salesforce Tutorial, Salesforce Online Training, salesforce, Opportunity Management
    CRS Mar 23, 2022
    1,745  Views
    Journey To A Salesforce Solution Architect

    Journey To A Salesforce Solution Architect

    Video in Salesforce Training

    A Salesforce Solution Architect must master a number of skills to be able to solve complex business requirements. In this session, we will cover 10…

    Salesforce Training, Salesforce Tutorial, Salesforce Video, Salesforce Learning, Business Requirements
    Rupal Kakkar Jul 8, 2021
    1,729  Views
    Guided Setup with Salesforce Field Service Administration - Webinar Recording

    Guided Setup with Salesforce Field Service Administration - Webinar Recording

    Video in Salesforce Field Service Platform

    Salesforce Field Service is a complete, end-to-end solution for customer service in the field. Salesforce Field Service brings together customers, employees, and products on a…

    Salesforce Service Cloud, salesforce, Salesforce Field Service, Service Cloud, customer service
    AblyPro Oct 27, 2023
    924  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.