Scenario 4 : Data Table in Screen Flows | Salesforce | Flow Builder Practice Set

Поділитися
Вставка
  • Опубліковано 6 жов 2024

КОМЕНТАРІ • 6

  • @bollinenikamalakumar6318
    @bollinenikamalakumar6318 Рік тому

    Hi, this is useful info and session. Thanks for sharing info. When I try to run the Data table flow, automatically enabled the first 3 records while I was selected "Row Selection Mode"

  • @harcharansingh4893
    @harcharansingh4893 7 місяців тому

    Did you create any vedio where user manually input the any column value in the table like if there is selection of product and you want to end user that enter the quantity for the same

  • @abhaypatle9380
    @abhaypatle9380 Рік тому

    How can we display the response data coming from the external service in the form of Data Table?

    • @bracesandsemicolons5730
      @bracesandsemicolons5730  Рік тому

      Hi Abhay! You need to make sure that the 'fieldName' in the columns definition matches the key names in your data objects. Also,make sure that the data you receive from the external service is in the format expected by the Data Table component. Generally, the Data Table in LWC expects an array of objects, where each object represents a row in the table, and each key-value pair represents a column in the table. Here is an example :
      export default class DataTableComponent extends LightningElement {
      @track data = [];
      connectedCallback() {
      // Make the callout to the external service
      fetch('api.example.com/data') // Replace with your actual API endpoint
      .then(response => response.json())
      .then(data => {
      // Once you get the data, assign it to the "data" property
      this.data = data;
      })
      .catch(error => {
      console.error('Error fetching data:', error);
      });
      }
      }
      And define the columns as this :
      const COLUMNS = [
      { label: 'Name', fieldName: 'Name', type: 'text' },
      { label: 'Age', fieldName: 'Age__c', type: 'number' },
      { label: 'Email', fieldName: 'Email__c', type: 'email' }
      // Add more columns as needed based on your data
      ];
      export default class DataTableComponent extends LightningElement {
      columns = COLUMNS;
      // ...
      }
      Hope this helps!

  • @rahilizharkhan4823
    @rahilizharkhan4823 Рік тому

    but how we can move selected row to next screen ?

    • @bracesandsemicolons5730
      @bracesandsemicolons5730  Рік тому

      Hi Rahil, you have to use onrowselection attribute on datatable and finding the record from your raw table data and push it to your event.detail.selectedRows to include it back in the selected rows.