Skip to content

csvDatatable

James Hou edited this page Feb 6, 2021 · 6 revisions

Note: Available for use on the App Page and Home page only for now.

This component is currently in BETA. During beta, please read Considerations carefully.

Provide a csv file with record Ids to load them into an inline editable list view.

Currently, this component supports only rows that exist in your org. You can think of this like an interactive dataloader, with a very low row limit.

csv-datatable

Fuzzy search column header matching to schema is powered by fuse.js. You do not need to have the column headers in any specific order.

This component uses the csv headers (after matching to your schema) to create a SOQL String to grab data rows from the org. It doesn't use any of the csv values unless they are for updating what is already in the database. In short, this is the psuedo:

SELECT -- field api names matched or fuzzy searched from column headers
FROM -- the SObject api name based on the first id given in the id column
WHERE Id IN -- (ids listed in the csv)

A few things are required to make this work:

  1. A column header of the Salesforce Record Id, this column can be labelled Id, SFDC Id, Salesforce Id etc.
    • This column must be filled out with the Id of each record you want to edit.
  2. Columns you want to be brought into the list view for additional context.
    • Since fuzzy search is used, you can use Field_Name__c, Field Name, Fld Nme.
  3. You do not need any cell values except for the fields you want to change and the record Id.
    • It is recommended to omit (leave blank) any value you are not planning on in-line editing, the component will grab values from the database anyways.

Considerations

  • Lookup field edits have not been tested.
  • Inline edit uses LDS, so make sure the user who is doing this has the correct FLS / CRUD.
  • The yellow marking draftValues that highlights the Id column is cosmetic only, you cannot update a Salesforce Record Id.
  • Limit the overall size of the datatable to < 2000 cells. So then, only provide a CSV like that contains something like the following:
    • 200 rows x 10 columns.
    • 20 rows x 100 columns.
    • 1000 rows x 2 columns.
  • If draftValues are applied strangely, please cancel and then manually edit with mass in-line edit.
    • Typically, this happens if you try to edit a lookup field.
Clone this wiki locally