migrate legacy image data for use with skuid's file upload component

  • 1
  • Question
  • Updated 3 months ago
  • Answered
Hello community!

I'm reposting because my other thread about this was marked 'Answered' but I didn't actually get an answer.

Skuid, is there any way to migrate legacy image data so it can be used by the File Upload component in 'Field on Record' mode?

Mike and Bill provided some work-arounds (great work, guys!), but there should be a way to migrate image data so that I can actually use the stock component in its existing structure. I have the file upload component on several pages pointing to a field on the record. I want to upsert my image data and have the images show up in the file upload component attached to the appropriate records. 


Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 months ago

  • 1
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
The other thread seemed to have a separate question that was more central to the original post which was answered. Because it is set to answered doesn't mean that all outstanding questions that have arisen since are acknowledged, but rather, the core is Answered. 

Because there is a found workaround on the page, it's considered answered. I'll switch this to an idea to see if our future product can include what you are requesting.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Wait, Stephen! I'm not asking for anything about Skuid to be changed!!! This is not an idea or feature request of any kind.

I'm just looking for guidance on how to migrate legacy data so it can be used by the file upload component.

My assumption is that someone there knows how the data schema is set up with skuid__Image__c that could give me a little direction.

Is that too much to ask?
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Hey Matt, great question! 

First off, just want to acknowledge that you are absolutely correct, this is NOT a feature request, this is a completely legitimate question about how to use a Skuid feature, so, thanks for asking your question, and I'll do my best to answer it.

The way I've done this in the past is with Excel and SFDC Data Loader, which can upload Attachments and associate them to records of an object. The main thing that is "hard" about this is keeping everything organized and properly linking up the Attachments to skuid__Image__c records and linking those records to fields on some other object, e.g. Contact or a custom object.

Roughly, this works like this:

(1) Use data loader to export the Contacts / whatever custom object that you are currently using, for which you want to populate legacy image data.

(2) Insert a skuid__Image__c record for each image that you want to associate to your fields, e.g. if you're storing a Photo of a Contact, you'd need to create a skuid__Image__c record for each Contact. You can do this using Data Loader. Make sure that the "OwnerId" is specified such that the appropriate users in your org will be able to access these records once created. Once you upload the records, the "successes" file should contain their Ids. Save this! You'll need these Ids for Step 2.

(3) Insert Attachments and associate them to the newly-created skuid__Image__c records. The "trick" to this is that you can upload the "Body" of the Attachments using data loader by including a "Body" field in a CSV, which is a file path to where your image data resides on your file system. Here's the SFDC docs for this: https://developer.salesforce.com/docs/atlas.en-us.dataLoader.meta/dataLoader/loader_attachments.htm. Make sure that the "ParentId" field is associated with a skuid__Image__c record that you created in (1). 

(4) Update the Lookup field that points to "skuid__Image__c" on your Contacts / whatever custom object to point to your newly-created skuid__Image__c records --- for this, you can again use Data Loader, you just need to use VLOOKUP or some other process to match up the Contacts / whatever to the newly-created Image records. For example, let's say your custom field is called "Silly_Photo__c". You will need to now use Excel to populate the value of the "Silly_Photo__c" field for each Contact to the Id of the corresponding skuid__Image__c record you created in (2). Use Data Loader to do an update on the Contacts, e.g. you'd just need to do a data loader update including the two columns "Id" and "Silly_Photo__c".

Hope that makes sense! I've done this in the past and it is pretty straightforward, using VLOOKUP() is very helpful for looking up Id values across Excel files. Basically use some sort of ordering / naming convention for your skuid__Image__c files and the associated Attachment image data, and then match-up Ids from newly-inserted records using VLOOKUP(), then Save As CSV and feed the CSV into Data Loader.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks, Zach! Very helpful.