Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Andrew Koltyakov
    @koltyakov
    No ideas guys, many environments with SSL and never faced the issue described.
    Can it be a reverse proxy in between?
    DANESHWARAN M
    @Daneshwaran
    Hello,
    I need to transfer files from SharePoint document library to another server, Please suggest an approach for this task pragmatically.
    Tim Parsons
    @timmparsons
    Hi, what is the best way to pull a list into a sharepoint webpart and have the list rows be able to be dragged and dropped into new positions?
    Shaun Pitt
    @shaunpitt
    Hi there @koltyakov could you tell me if sppull could be used to copy a file from one library to another. thanks
    Andrew Koltyakov
    @koltyakov
    Hi @shaunpitt, nope, it's for fetching document to a local disk within dev pipelines or some Node.js processes.
    Theoretically you can download with sppull/sp-download and upload to another location with spsave, however metadata, versions, permissions will/might be lost.
    Why not move/copy documents with the API? Or it's a migration and different farms?
    marsbaa
    @marsbaa
    Hi @koltyakov , is there a way for node-sp-auth to work with Two-Factor Authentication?
    Shaun Pitt
    @shaunpitt
    Hey thanks @koltyakov
    Yes it was for migration project.
    Different tenants SP online
    marsbaa
    @marsbaa
    Hi guys, is there a way for node-sp-auth to work with Two-Factor Authentication?
    Andrew Koltyakov
    @koltyakov

    Hi @marsbaa,

    With 2FA it's possible authenticating using:

    JRN
    @rjgmail88
    Hi, is there a way to Bind share point list to a Sql Db tables to fetch updates dynamically. Example: I have a share point list of 2 columns and, I have a azure sql Db table with 2 columns. I would like to bind them together so when an update is happened in DB column, respective share point list column data will be updated.
    Andrew Koltyakov
    @koltyakov
    Hi @rjgmail88! You can sync the list data with a custom handler, a job which checks updates in SharePoint list and sync data to the table. Change API can be handy to track what was changed since the last sync session (including service metadata changes, like permissions, and deletions or item recycle/restore). Based on SharePoint version (On-Prem/Online) events can be used to shrink the actuality time, in On-Prem it can be an event receiver, in SPO - remote event receiver or, what is better, webhooks. Also, a variety of ETL support SharePoint list as data source, e.g. SSIS can consume a list as OData data source.
    JRN
    @rjgmail88
    Hi @koltyakov thanks for prompt response. I apologies if I was not clear but, I would like to sync to Share point list from sql Db. So triggers will be from sql. My app primarily writes to DB so I would like to sync that to Share point list when there is change in DB.
    Andrew Koltyakov
    @koltyakov
    @rjgmail88, SQL data can be exposed as an external list using BCS. However, it can be a bit tricky and itchy configure-wise and external lists have their own nuances which distinguish them from the ordinary SharePoint lists.
    So depending on a task, BCS can be considered. But synchronization from SQL to SharePoint list with a custom job can be more beneficial and even smooth.
    The tools for a sync job can vary based on your programming language preference. Node.js with node-sp-auth and sp-request or PnPjs do their job nicely on SharePoint side, tedious or any other SQL lib can be used for fetching SQL data. If preferred, C# + CSOM can be the thing. PoSH can be used as well. Or even Golang.
    JRN
    @rjgmail88
    Thank you @koltyakov . What is BCS ?
    Andrew Koltyakov
    @koltyakov
    William Yin
    @williamyinssw
    @koltyakov Have you or anyone else tried to use https://pnp.github.io/pnpjs/nodejs/docs/sp-fetch-client/ to talk to on premise SharePoint?
    Do you see an error "SPFetchClient TypeError: Cannot read property 'filter' of undefined" - described at pnp/pnpjs#603 ?
    Sergei Sergeev
    @s-KaiNet
    @williamyinssw sp fetch client shipped with pnpjs doesn't work with on-premises sharepoint (in nodejs)
    you should use https://github.com/SharePoint-NodeJS/pnp-auth to add support of on-premises sharepoint in your nodejs app
    William Yin
    @williamyinssw
    Thanks @s-KaiNet If that's the case, I think the instruction at https://pnp.github.io/pnpjs/nodejs/docs/sp-fetch-client/ | "Register An Add-In" section is misleading, it's saying "but can work on-premises if you configure your farm accordingly."
    Andrew Koltyakov
    @koltyakov
    Hi William, it’s not misleading but only relevant to SharePoint Online. In On-Prem, Add-In authentication flow is different.
    William Yin
    @williamyinssw
    Thanks @koltyakov. but I am confused now, I understand that add-in-auth can work on both SPO and on premise SharePoin with diffent flow, but can sp-fetch-client method work with on premise SharePoint add-in-auth or not based on your experience?
    Sergei Sergeev
    @s-KaiNet
    sp-fetch-client uses azure access control services (aka ACS) in order to create oauth access token and to further authenticate http requests. It's called low-trust authentication. That's the default flow used for add-in for sp online. on-premises SharePoint uses different technique for authentication, thus it's not possible to directly use authentication from sp-fetch-client. However you can configure your on-premises sharepoint to run apps in low trust scenario (in the save way as for sp online), in that case you will be able to use sp-fetch-client. However the process of configuring is very complicated and error prone (from my experience).
    Andrew Koltyakov
    @koltyakov
    From our experience, we never configure Add-Ins in On-Prem, Add-Ins (as a dev model) doesn't make any sense these times. In On-Prem I prefer sticking to service accounts.
    Sergei Sergeev
    @s-KaiNet
    +1 to Andrew)
    William Yin
    @williamyinssw
    Thanks @s-KaiNet @koltyakov for sharing your experience and knowledge, I understand it now :)
    Nicholas Valbusa
    @squallstar

    Hi everyone! Does anyone have experience in reading an image file in Node.js from a Sharepoint 2013?

    I haven't found much online in terms of docs and reading the file with its direct URL using the "sp-request" npm package doesn't seem to work.

    Sergei Sergeev
    @s-KaiNet
    Hi, you can try https://github.com/koltyakov/sppull
    under the hood it uses sp-request, thus most likely you're doning something wrong
    Nicholas Valbusa
    @squallstar
    @s-KaiNet thanks, the code is very basic but doesn't seem to work as intended
    const credentialOptions = { username: '', password: '' };
                      const spr = sprequest.create(credentialOptions);
    
                      spr.get('http://mysites/User%20Photos/Profile%20Pictures/nhayman_LThumb.jpg').then(function (response) {
                        return response.body;
                      });
    normal SP requests made work fine, but somehow reading images don't
    Sergei Sergeev
    @s-KaiNet
    it won't work, because for downloads you should use SharePoint REST api, ie. to download a file /_api/Web/GetFileByServerRelativeUrl(@FileServerRelativeUrl)/$value
    Here is some documentation - https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest#working-with-files-by-using-rest
    Nicholas Valbusa
    @squallstar
    I see, is it just a matter of writing the URL differentely or I just can't use this lib and need to use like the plain "node request"?
    e.g. should this work with the sp-request lib and return the raw image data?
    http://mysites/_api/web/GetFolderByServerRelativeUrl('/User%20Photos/Profile%20Pictures')/Files('nhayman_LThumb.jpg')/$value
    Sergei Sergeev
    @s-KaiNet
    yes, it should work with sp-request
    Nicholas Valbusa
    @squallstar
    OK so response.body should be the raw data? as I can't see anything in the doc aside from response.body.d
    Sergei Sergeev
    @s-KaiNet
    I don't remember what is exactly in the response body, because there are two types of REST API endpoints for file downloads. the first one is $value and the second one is OpenBinaryStream
    you can try and see the response
    maybe @koltyakov can help here better than I am
    you can also use raw "node request", but in that case you should provide authentication headers, here is an example I found
    https://sharepoint.stackexchange.com/questions/214212/download-sharepoint-document-with-rest-as-binary-file-not-working-for-me
    Nicholas Valbusa
    @squallstar
    @s-KaiNet thanks for all the help, really appreciate that!
    Andrew Koltyakov
    @koltyakov
    Hi @squallstar, one important thing to provide is encoding=null parameter to the HTTP client. You can take a look into implementation of sp-download method https://github.com/koltyakov/sp-download/blob/master/src/api/Download.ts#L79
    If it's small files like images sp-request is a perfect buddy (e.g. https://github.com/koltyakov/sppull/blob/master/src/api/index.ts#L313), if you need to download large sp-download or a custom implementation to be able to download as stream (another example with pipes https://github.com/koltyakov/sppull/blob/master/src/api/index.ts#L277). sp-request uses request-promise which doesn't support streaming.
    Christopher Gore
    @chrisgore
    Hi, I am getting a 407 error. Proxy Authentication Required. I am trying to use node-sp-auth to find the correct parameters so I can use SPGo. My company uses OneLogin. I don't understand how to make the call to get the required information.
    Nicholas Valbusa
    @squallstar
    @koltyakov thanks! :pray:
    @koltyakov here's how I've currently set up the code to download the file, where am I supposed to add the encoding parameter?
    const spr = sprequest.create(credentialOptions);
    
    spr.get(fileUrl).then(function (response) {
      return response.body; // I'm not writing the file to disk because I need to send it to another API
    });
    Christopher Gore
    @chrisgore
    I think the issue is because of MFA. Not able to pass through. I do however have the proxy script address. ??
    Andrew Koltyakov
    @koltyakov
    image.png
    @squallstar, the second parameter is options.
    Andrew Koltyakov
    @koltyakov
    @chrisgore, to overcome 407 error the environment should be configured with HTTP_PROXY and HTTPS_PROXY settings.
    To deal with MFA you need additional setup or using On-Demand auth strategy.
    Christopher Gore
    @chrisgore
    @andrew koltyakov , how would I set the Proxy settings?
    Andrew Koltyakov
    @koltyakov
    Node.js processes are configured behind a corporate proxy by defining HTTP_PROXY/HTTPS_PROXY environment variables in an appropriate way for a platform, e.g. HTTP_PROXY=http://my-proxy HTTPS_PROXY=http://my-proxy node ./index.js. As you're talking about VSCode extension you can try setting up these environment variables, not for a console process but OS user.
    grangeway
    @grangeway
    I don't suppose anyone here is running sharepoint with custom ifilters on-premises? Currently hitting an issue where it seems to fail on files >128MB (despite setting MaxDownloadSize) - just wondering if I can find anyone else with a similar setup that might know if there's a issue with large files. I know historically 2013/2016 have had bugs, but not aware of anything current for 2019