by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    eralardz
    @eralardz
    I will check that out
    But I think i will need user context
    Sergei Sergeev
    @s-KaiNet
    in that case maybe for you it's better to use azure ad oauth authentication to establish a user context and get all the data from sharepoint, for example
    https://github.com/AzureADQuickStarts/WebApp-OpenIDConnect-NodeJS
    eralardz
    @eralardz
    Thanks, I will check it out
    Sergei Sergeev
    @s-KaiNet
    but, to be honest, when it comes to development against SharePoint and \ or Office 365, there are a lot more tools and libraries for .net rather then node...
    eralardz
    @eralardz
    Yeah, I'm only starting out. There is so much...
    I've tried SPFX but I've found it to be pretty limiting.
    If you compare it to a SPA
    I'm actually creating an SPA, backed by SharePoint
    ... or trying to ;-)
    Sergei Sergeev
    @s-KaiNet
    if it's spa, consider https://github.com/AzureAD/microsoft-authentication-library-for-js
    msal.js is used to creat spa which are able to use SharePoint api as well
    under the samples folder they have some exmples of applications
    Anuj Kumar Pal
    @Anujkmrpal
    Hi i need help in sppull i am got getting metafileds when query with camlCondition
    Andrew Koltyakov
    @koltyakov
    Hi @Anujkmrpal can you describe your issue in more detail and post with a repro sample in sppull repository project? I'll take a look.
    Anuj Kumar Pal
    @Anujkmrpal
    @koltyakov When i send use only metafileds i get the metadata
    but when i use camlCondition with metaFields i get empty metadata
    1.png
    2.png
    Andrew Koltyakov
    @koltyakov
    Got it. Will take a look later today.
    Anuj Kumar Pal
    @Anujkmrpal
    and also ListItemAllFields is not appeared when using camlCondition
    Anuj Kumar Pal
    @Anujkmrpal
    @koltyakov Is there any hotfix for this. I am in some urgent development
    Andrew Koltyakov
    @koltyakov
    don't use CAML, maybe
    send another request for getting metadata, etc.
    Anuj Kumar Pal
    @Anujkmrpal
    @koltyakov I need to get metadata for the file searched, So if i dont use CAML then i will get all files which use more data, space and time, Is there any other way
    Even if there any way to get ListItemAllFields when using CAML
    Andrew Koltyakov
    @koltyakov
    your query condition is pretty simple why not using restCondition instead?
    Anuj Kumar Pal
    @Anujkmrpal
    @koltyakov can you share any document or example for it
    Anuj Kumar Pal
    @Anujkmrpal
    3.png
    @koltyakov can you tell what is wrong with restcondition in this as the result is not as per restcondition
    Andrew Koltyakov
    @koltyakov
    @Anujkmrpal
    Was able to check and metaFields work together with camlCondition nicely. Regarding restCondition, my bad I've forgotten that I abandoned the idea for bypassing REST conditions (there was an interface for that by no handler).
    But, confirming CAML+Metadata extraction should work just fine.
    image.png
    Anuj Kumar Pal
    @Anujkmrpal
    @koltyakov You Didn't use spDocLibUrl which i think mendatory with camlCondition, So camlCondition didn't work in your case only metaFields works thats why it shows metaData
    correct me if i am wrong
    Andrew Koltyakov
    @koltyakov
    Fair point. Sorry, I missed this out. It was really a bug with getting metadata with CAML, fixed, publishing a version.
    image.png
    Please check with sppull@2.6.1
    Anuj Kumar Pal
    @Anujkmrpal
    @koltyakov Thanks working now
    Andrew Koltyakov
    @koltyakov
    Happy codding!
    paulinedahneaspire
    @paulinedahneaspire

    sp-rest-proxy help please
    I am trying to set up a dev enviroment but cannot get SharePoint Online auth working.
    npm install sp-rest-proxy --save-dev
    server.js
    const RestProxy = require('sp-rest-proxy');

    const settings = {
    configPath: './config/private.json', // Location for SharePoint instance mapping and credentials
    port: 8080, // Local server port
    staticRoot: './static' // Root folder for static content
    };

    const restProxy = new RestProxy(settings);
    restProxy.serve();

    paulinedahneaspire
    @paulinedahneaspire
    when I run npm run serve and enter the SharePoint url, name and password the proxy runs successfully. However when the SharePoint Online project starts up on http://localhost with npm run start I am unable to retrieve the SharePoint Online data. There is no error message - just a progress wheel however when I use the browser inspect tool the first error under the Network tab is
    Request URL: https://xxxxxxxxxxxxxx.sharepoint.com/sites/CMDev/_api/web/currentuser error 403
    x-msdavext_error: 917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.
    The error message is always the same - permission denied. It appears that the SAML token is not being passed through to npm run start
    Andrew Koltyakov
    @koltyakov
    Hi @paulinedahneaspire, in a local workbench you have to route requests not to SharePoint URL but proxy endpoint. http://localhost:8080/sites/CMDev.
    paulinedahneaspire
    @paulinedahneaspire
    Thank you for you very quick reply. So do I need to edit the exportsiteurl.js to point to http://localhost as opposed to https://xxxxxx.sharepoint.com/sites/cmdev ? If so do I include the port :8080 in the exportsiterurl.js ? Thank you
    Andrew Koltyakov
    @koltyakov
    Have no idea what's exportsiteurl.js. Custom config within your particular app I guess. There are two techniques: one is conditionally switching endpoint URL (on localhost condition, similar as this helper does) or providing local server (WebPack Dev server, for instance, has API proxy setting) an extra setting to route to sp-rest-proxy. First one is simpler in configuration, though not so sophisticated as configuring workbench.
    I'm wondering, what's is used for local serve?
    paulinedahneaspire
    @paulinedahneaspire
    Thank you again. As you may have guessed I am not the developer. I am a SharePoint specialist that has been asked to setup a dev environment for a React project that has been developed by consultant that we can no longer get hold of. I am following the instructions he has left but they appear to be lacking
    Andrew Koltyakov
    @koltyakov
    On my projects, I mostly prefer extending WebPack Dev server config with sp-rest-proxy. So serve command actually starts only one server. As a scaffolding example, generator-sppp shows how it could be configured. It provides the configuration right OOTB. Yet, if one prefers CRA or used to a specific framework configuration, sppp is better to be used as a sample to grab some code from.
    Andrew Koltyakov
    @koltyakov
    Something to add, SPPP is for the projects which are in between of SPO and On-Prem. And for the folks who consider simplifying transitioning from classic to modern dev, of got to stick for some time with classic but do it in a more robust way. For SPO, I'd suggest considering Modern and SPFx. With SPFx, sp-rest-proxy can be used, however, there is a common way of opening SPFx webpart in SP hosted workbench or using SPFx debug mode.

    has been developed by consultant that we can no longer get hold of. I am following the instructions he has left but they appear to be lacking

    It can be so many moving parts and opinionated decisions.

    paulinedahneaspire
    @paulinedahneaspire
    Thank you again. Your first response was extremely useful. I have edited the exporturl file to point to localhost:8081 and all is working! :-)
    Andrew Koltyakov
    @koltyakov
    Cool! Glad it works now. Good luck on the project. It's always a pain when somebody left the gaps.
    michaelcmelton
    @michaelcmelton
    Hey, all. New to interacting with the SP REST API. I've build a function that retrieves the data via ajax, and a separate "main" function that runs all the calls. Is there an easy way for me to pass variables between the two functions without calling global variables and muddying the waters on the window object? In particular, I'm trying to dynamically build a JSON file with the data as I'm looping through it, and at the end read the JSON to a new file. Hopefully that makes sense.