Code Monkey home page Code Monkey logo

excelupload's Introduction

Excel Upload Lightning Web Component

Extract values from an Excel sheet to record fields while uploading

Description

A Lightning Component that allows you to upload an Excel File to a record (e.g., Account, Opportunity, Custom Object), extracts certain cells (e.g., A1) from it, and sets them as field values in the record detail (e.g., Opportunity.Amount).

Highlights

  • Extract/parse values from a complex excel into a Salesforce record, while uploading the Excel sheet as an attachment to the record
  • Build you regular Salesforce processes (e.g., approvals) on the record and reduce the e-mailing around those Excel files
  • Combine the flexibility of Excel sheets with well-structured Salesforce processes

Details

Use this component when you need to extract/parse values from an Excel File. It has been used mainly in approval processes, where users submit a complex Excel sheet as attachment to the to be approved record and certain header or otherwise important values should be taken over from that Excel Sheet.

License

See LICENSE file in this repository.

This component uses the SheetJS Community Edition library, which is licensed under the Apache License 2.0. See the LICENSE file in force-app/main/default/staticresources/sheetjs.

excelupload's People

Contributors

meckert-salesforce avatar mieckert avatar svc-scm avatar tepp0f3l avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

excelupload's Issues

Excel uploader not displaying error message when there is an upload issue in Salesforce

When attempting to upload an Excel file to Salesforce using the Excel uploader, there are cases where the upload fails due to some salesforce upload issue. However, the uploader does not display any error message, but the values are getting updated to the object. So the user is not able to see any error message and its making it difficult for the user to know what went wrong.

Error on native Excel formatting for Date, DateTime and Percentage

Using Excel for Mac and the xlsx format on MacOs Catalina with english but german locale the following is observed:

  • I receive "Error: unknown" errors when uploading a file with references to fields which hold the native formats for Date, DateTime.
  • I also receive wrong values (to big by the magnitude of 10) for fields with the native Percentage format.

Workaround:
In order to upload such files I need to use the TEXT() function in additional cells to turn the native values into formatted string representations, e.g.

  • Date: '=Text(DateCell;"Yyyy-MM-DD")'
  • DateTime: '=Text(DateTimeCell;"Yyyy-MM-DD hh:mm:ssZ")'
  • Percentage: '=Text(PercentageCell;"##%")'

It would be helpful if this could be documented or at least the error would be bit more descriptive.

Comments:

  • The used library (SheetJS) seem to be able to derive the formatted values (e.g. https://oss.sheetjs.com/sheetjs/) from the original cells.
  • Hence I assume based on the documentation for cell-object that instead of using the "Raw Value" as in 'record[field] = cell.v;' it might be better to read the "formatted value" - cell.w for such data types.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.