Some thoughts on programming stuff

Sync SharePoint files with VS Code

The last three months I’ve been working less with SharePoint and more with Angular 4/Node JS projects. This change forced me to use less Visual Studio and dive deep into Visual Studio Code in almost every task. I must say that I fell in love with the editor and decided to search about how to sync SharePoint files with VS Code.

While working with VSCode, I’ve been testing some Gulp tasks like SPSave and SPSync for automatizing file changes to SharePoint, just for fun. Because I just can’t accept SharePoint Designer anymore, my patience with it ran out.
Also the Windows feature to map a network drive to a SharePoint library isn’t good too, at least for me.
So basically the gulp tasks did the trick, but they aren’t that easy to be understood for some more “traditional” programmers in my company, which would end with few adopters here.

So while searching for SharePoint extensions just for curiosity, I found the SPGO Extension and it really impressed me!

Basically it’s an extension that with some basic setup you can start syncing files from your computer with SharePoint libraries.

SPGo Extension

SPGo Extension

Enabling the extension

I was able to sync, check-out and publish files from my Editor without needing to do these tasks manually. Just had to install the extension, open a folder and add a JSON file named SPGO.json like that:

Using the extension

After creating the SPGO.json, you can initialize the repository and voila!

Settings for the extension

Settings for the extension

After all that time syncing the files and folders, you can edit the them and use the contextual menu to publish your changes.

Contextual menu available with the extension

Contextual menu available with the extension

The extension is in its early stages, but already works really well with SharePoint Online. I faced some issues with On Premises authentication, but I believe that in the future they will be tracked and solved.

Anyway… I’m glad that I was able to sync SharePoint files with VS Code and work with them like a SharePoint Designer editor. If enjoyed the possibility of using a better editor for SharePoint files, you may also be interested on optimizing your SharePoint development environment to work even better.

Furthermore, I must admit that it has a lot of potential and will help me in my work! What are your thoughts about the extension? Let me know in the comment section below!

References:
SPGO Extension

18 Comments

  1. David

    Nice article, I will be checking out the VS Code extension. I am also a SharePoint Developer.

    • Wiliam Rocha

      Hey David, thanks for your feedback! Hope it was useful for you!

  2. online time management games y8

    Good post. I learn something totally new and challenging on sites
    I stumbleupon everyday. It’s always exciting to read content from
    other authors and use a little something from other web sites.

    • Wiliam Rocha

      Thanks Shana! Hope you can keep learning and sharing knowledge with us!

  3. Erick

    Good article!

    Did you ever got an On Premisse site working?

    • Wiliam Rocha

      Hey Erick!
      Thanks for the feedback!
      I got it working into SharePoint 2013 and 2016. The only difference was using the “Domain\Account Name” format for the username, not the e-mail.
      Let me know if it works for you 😉

      • Vaibhav

        Yes, email was not working for me also.. It accepted Domain\Accountname. Can anyone help me to know that how we can refresh the workspace using SPGo command considering someone changed file directly on Sharepoint site.

  4. Carlos

    Hey William,
    Good article, it works but…
    Style Library is not being imported, do you know why?
    rewards,

    • Wiliam Rocha

      Hi Carlos!
      Thanks for the comment!
      Since I believe you are using the same settings as me SPGo.json, could you try encoding the Style Library URL like “Style%20Library”?
      Thanks!

      • Marcos Vinicius Araújo

        Very good article, thanks!

        I have the same problem. My settings in my SPGO.json are ok and I tried using “Style%20Library” and not work.

  5. Matheus

    Boa tarde.

    Estou em busca de acelerar o desenvolvimento dos meus projetos, com uso da ferramenta ao salvar ele atualiza direto no site de primeira? Ou precisa dar muitos reloads no browser ?

  6. Rushikesh

    Hey Wiliam …

    Thanks for the nice article… I have an issue to connect with sharepoint O365 account. I have followed all the steps as mentioned in your article.

    I have two sharepoint sites
    1) Personal account (onmicrosoft.com)
    2)organisation account (user@company.com)

    I am able to connect with first account (personal account) and loaded all data from server successfully.
    But unable to load data from second site(organisation site). It just keep saying “populating workspace” but nothing gets loaded. Can you help me with this.

    I am using VS Code Ver : 1.23.1 and SPGO ver : 1.3.2

  7. Vaibhav

    Can someone help me to know that how we can refresh/resync the SPGo workspace to get server changes using SPGo command considering someone changed file directly on Sharepoint site.

  8. Lavern

    Appreciate the recommendation. Let me try it out.

    • Wiliam Rocha

      You are welcome, Lavern!

  9. Susan Castillo

    nice! I am not a developer but for sure I want keep on eye on this IDE.

    I am trying to do :

    1) Create an email alert when an item is create in my list. I want that specifically this email contains the attachments too. Does anyone knows if it is possible?

    2) I have already two lists (listA and listB) in the same site. I want to copy some columns from listA to listB. Is that possible by coding too?

    I would love some guidance!

    • Wiliam Rocha

      Hello Susan!
      I highly recommend you on mastering VS Code. It’s a pretty useful code editor.

      About your questions:
      1) Create an email alert when an item is create in my list. I want that specifically this email contains the attachments too. Does anyone knows if it is possible?
      Go for Microsoft Power Automate. Here you can find a way to do that: https://www.youtube.com/watch?v=_iId3Ki3SPM

      2) I have already two lists (listA and listB) in the same site. I want to copy some columns from listA to listB. Is that possible by coding too?
      That’s possible using code like SharePoint CSOM. Here is a place where you can find how to create columns programatically: https://karinebosch.wordpress.com/my-articles/creating-fields-using-csom/

      Best,
      Wiliam

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2024 wiliammbr's blog

Theme by Anders NorenUp ↑