Paste values into table

edited October 15, 2019 in Questions
Is it possible to paste data into a table?  Specifically - I'd like to be able to paste rows of Excel data into a table of Salesforce data.  (Of course I'll need to be careful that columns in Excel match columns in Skuid, etc.) 

Alternatively - is there a way to add an "import" button to a table? 

Comments

  • edited October 15, 2019
    Elissa,

    Yes, it is possible to implement copy/paste to create rows in a table, but it would take some custom JavaScript code. Some of our solutions engineers have done this before.

    Regarding your "Import" button question, there are a couple ways to achieve this:

    (a) Implement your own in-browser CSV parser with a library like PapaParse, and use Skuid's File Upload component to let users upload a CSV file and then parse the CSV file. Here's an example page: https://gist.github.com/zachelrath/3e572cd55caf7a98e4796c53b3d24973 (and here's a sample CSV file to use for testing: https://gist.githubusercontent.com/zachelrath/89cb4ba214bd5c212093c9ca1c4a4047/raw/ea848c2618556aa6678ebbca5a29c76c4f1fd19b/MockUserImportData.csv)

    (b) If you are using Skuid-on-Salesforce, there is an Import Wizard (which is not brandable or customizable, be warned) which you can get to with a button / table action at the URL "/apex/skuid__Import?obj=Contact" (swapping out "Contact" with the API Name of the object you want to import).
  • edited June 26, 2019
    Thanks so much, Zach!  I need to set a few values on all imported lines (I'm importing Quote Lines - so I need to set the Quote ID), and as far as I can tell there's no way to do that with the Import Wizard without making sure that the user manually adds a Quote ID column to their sheet.  But - it looks like I could pass in some additional conditions to the Javascript for the CSV parser.  I will give that a try.
  • edited June 26, 2019
    Elissa, actually, there IS a way to do exactly that --- just populate the field values in the URL, e.g.

    /apex/skuid__Import?obj=QuoteLineItem&QuoteId=00923234234234

    so in a Skuid button you could use Merge Syntax to populate the Quote Id from a separate Quote Model like this:

    /apex/skuid__Import?obj=QuoteLineItem&QuoteId={{$Model.Quote.data.0.Id}}

  • edited June 26, 2019
    These options are great. I forget about the import wizard. I would like to vote to have “import” added as an action that allows you to set a model/object and parameters and conditions and context. For example: import rows to the contact object and set the account ID to the account Id of the row in context and only import rows that have an email address. Having it as an action makes it more top of mind and will likely prompt more adoption and allow it to be used in row actions, global actions and buttons, etc... and to add post-import actions like requery and transforming data.
  • edited June 26, 2019
    Agreed that this would be fantastic - though with Zach's URL trick I can get pretty close to the functionality I need.  I'm playing with the CSV parser page and that's working very nicely as well.  I now have two great options - thank you both!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!