function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

SwivelScript for Salesforce

Hi all,


I would like to invite you to have a look at the demo of the upcoming 'SwivelScript for Salesforce' on


'SwivelScript for SalesForce'   turns Salesforce into a desktop automation tool, configured entirely in Javascript using Salesforce customization. This enables the integration of legacy desktop applications without the need for expensive serverization.


Let me know if this looks useful to you.




Edwin van der Sanden


After watching your video, I have mixed feelings. I'm wonderfully excited to see what it could do, but I'm really concerned that this product could be a disappointment if all it can do is copy and paste between Notepad and Salesforce.


Are we going to be limited to to copy-pasting plain data, or will we be able to use this type of logic in places like:



  • API Calls from the browser. Be able to update a related record by copying changes from a desktop application? Edit a list of records in a spreadsheet application and have all of them updated simultaneously (without the hassle of Excel Connector)? The concern here is being able to export data in a format that a program like Excel can comprehend as fields/columns instead of just plain text.
  • Within certain fields. Create rich text emails in Outlook, Composer, or some other HTML editor, and paste that back into a Rich Text Field or HTML Email? Some programs won't copy the Rich Text code-behind if the target is a plain-text application, so formatting should be preserved.
  • In a bookmarket. Click a bookmark on your toolbar, and perform some type of action against the current page, such as exporting a list view into Excel without a custom button, or dropping the contents of a record into an offline database? The List View button would work too, but sometimes its nice to have this flexibility. An advanced user should be able to invoke functionality without depending on the administrator. The profile in Salesforce should stop users from doing anything they couldn't do manually through this script.
  • Edit data in a complex form. Could we invoke Outlook's "Edit Contact" screen, put some data from the contact into Outlook, then when we leave, update the contact? This question focuses on Application API; many programs have the ability to have complex inputs, and ideally this application should be able to support that complexity.
  • Instant Messaging. Could I Instant Message a contact in my favorite IM application, and then, with a click of a button, copy the contents of the chat window into a new Task on that contact? This is a two-parter, as it focuses on possibly grabbing a window that was not spawned by the application and using that content, and as a follow-up, what security mechanisms would be in place to prevent abuse or neglect by a system administrator or intruder.
  • Export data to a non-windowed or daemon application. Could the system invoke a system script, or connect to an ODBC connection to update the database or update the record?
  • Support my operating system. Will my Linux box be completely unable to run this script? Can my colleague with his MaxOS X machine be able to connect to his desktop applications? Windows might be a majority usage right now, but with more people making the switch, Mac and Linux is not so much of a niche anymore, and should probably be supported as well. I'm not advocating supporting every OS ever, like BeOS, MenuetOS, Solaris, and so on, but at least be aware that Microsoft is not the only option for many users these days.
  • Dynamically support similar applications. If I have OpenOffice instead of Microsoft Office, or if I have SciTe instead of Notepad, will there be a mechanism to support choosing the most appropriate file editor? Increasingly, you will come across users that will not be using the latest Microsoft software because of budget, personal preference, IT policy, or a myriad of other reasons.
The concept that your integration offers is indeed innovative, but what will it actually be able to do? Users are probably not going to "ooohhh" and "aaahhh" over exporting to Notepad, but if it offers the potential to save time in an easy-to-use way, I think your product is going to literally take off. I'm excited to see what you've got up your sleeves. I understand that you might not have any answers, or that I might be jumping ahead on your road map, but really I just want to try and throw out some ideas of what I think would be really nice to have in that integration of yours.




Thanks for your comments and positive feedback, and let me try and take away some of your concerns while I answer your questions. In short, if the data is accessible via the Salesforce UI, you can send it to any desktop application, in any format.( I have the used headings from your post )


1. API Calls
Since the entire Salesforce Web Services API is available via the AJAX Toolkit ( ) , you can eaasily achieve your proposed scenario. I'll try and make some time to build an example of using Excel to batch-up date a list of Salesforce contacts. If you can provide me with a Javascript function to batch update Salesforce, which I could drop into this demo, that would be great!    

2. Pasting RTF / HTML
I'm not entirely clear about the scenario, but you will have access to the raw clipboard data from Javascript, so you can get to copied RTF or HTML without a problem.   


3. Bookmarklets
As long as the Javacript library has been import in the Salesforce page, you will be able execute bookmarklets that access the Swivelscript API.


4. Complex data entry

This will require packaging Swivelscript with application specific automations, which is on the roadmap, but won't be in the first release. The first release of Swivelscript will be application agnostic.   


5. IM
This will definitely be possible. Swivelscript can access Windows and Application that were spawned by the users themselves. In fact, this would be the recommended approach, versus having it spawn applications for you.   

6 .Non windowed apps
This would be a roadmap feature for now since I am planning to focus on Windowed apps. Technologically though, it will be an straightforward extension of the v1 product. Do you think this will be a killer feature that should make it into the first release?   

7. Other OS
Definitely on the roadmap! Which Linux flavor do you see most?   

8. Dynamic apps
 As mentioned in an earlier point, v1 of Swivelscript will be application agnostic, so you will be able use any text editor, mail client, messaging client, office suite, etc.

I see you mention some issues w/ the available Outlook , and Office connectors. Could you elaborate, just so I won't make the same mistake.

Thanks again.



Great to hear that you've got this well thought out. I'll answer the questions you had in the order I originally had, to keep the tempo.


1. Example API Call:



// Use this syntax in a button, it will add the URL to the page's script includes

function doUpdate() {
  var updatedRecords = "get data from SwivelScript here as an array of named index arrays (or just arrays)"
  var records = new Array()
  for(var record in updatedRecords) {
    var newRecord = new sforce.SObject("Account") // Type of record here
    newRecord["Id"] = updatedRecords[record].Id
    newRecord["Name"] = updatedRecords[record].Name
    newRecord["Custom_Field__c"] = updatedRecords[record].Custom_Field__c // You get the idea

  // use async callback method
  sforce.connection.update(records, { onSuccess : processResults, onFailure : displayError } )

function processResults(results) {
  // everything went well with API, check results

function displayError(errors) {
  // something bad happened, bad field name, etc

// Do your code here, then call doUpdate()


2. To clarify, programs like Microsoft Word will paste different data depending on the target application. As a simple example, open an HTML editor, Microsoft Word, and Notepad. Type some words into Word, apply some formatting, then copy and paste both into your HTML editor and Notepad. In Notepad, you'll see only the text without formatting (obviously, because Notepad does not support formatting). Your HTML editor should retain the formatting you placed in Word when you paste from Word. As long as your script can identify itself as a Rich Text capable input to the OS, you should be okay. I believe your statement that you have "raw access" to the clipboard suggests that formatting should be preserved when possible.



3. I won't lose too much sleep over it, because most likely it's more of a pipe dream; bookmarklets are extremely simple scripts that are browser dependent. However, I do think that some developers might make some chrome extensions for Firefox to support SwivelScript integration...


4. You don't necessarily need to determine the precise application, I just think it'd be nice if the clipboard data was in several formats and the recipient application can choose the most appropriate format. Windows (and I believe the other OS's) supports placing multiple objects in the clipboard with each object representing a different format of the same data. Giving a line-based format and a CSV-based format might be sufficient for most uses, along with a Rich Text format for fields that support it.


5. I'm glad to hear about the IM bit. Again, if you can grab the data in a Rich Text format when applicable, it would go a long way in improving readability when it gets to Salesforce.


6. I'd say hammer out the GUI logic first, then worry about esoteric cases such as connecting to ODBC. I would anticipate that 90% of users would want to do some fancy editing and/or moving data into and out of their normal applications, while connecting to a database that runs as a service or daemon is probably something that only consultants and developers would really care about (and occasionally the System Administrator that actually learned how to move beyond reporting and customization). I'd be willing to wait for this for v2 as long as v1 was a rock solid performer.


7. If you can cover Red Hat, Fedora, and Debian, with Gnome and KDE, you'll have nearly 100%  the Linux GUI covered, since command-line users wouldn't be able to use this script anyways. I would say RH would be the primary focus, since they position themselves as an "Enterprise Linux" and are probably the most common Linux in production environments (if I'm wrong, please let me know!).


Like I said before, great stuff, and I hope it works out well. If you need someone to toy around with it, let me know!


Hi there!


I have built de Excel integration and posted a demo on my blog . Have a look and tell me what you think. It's here :


sfdcfox : Once I have a build for you to try I'll send you a link so you can have a play.



Edwin van der Sanden




Couple of questions:

1. Does swivelscript require any changes in browser's security in order to interact with desktop applications directly from JavaScript running within a browser?


2. I had a look into the demo source and noticed that it includes swivelscriptloader.js via HTTP rather than HTTPS - would this not cause the browser to complain about mixed content (SSL and non SSL) ?





I don't want to go into the technical details of the integration, all will be revealed when the product launches. As for your second question, no there are no warnings. I think this is because javascript is not deemed content.




Edwin van der Sanden.