SharePoint framework Vs SharePoint hosted add-in, when building CRUD operations

Steel Contributor

Previously (Early stages of sharepoint online) i use to build many sharepoint hosted add-ins to implement scenarios such as:-

1. using node.js or pure javascript, i build a sharepoint hosted add-in.

2. the add-in integrates with sharepoint lists using REST api.

3. i use this approach to implement some advances CRUD operations that can not be achieved using sharepoint lists' views and forms. something similar to what is provided in this link https://www.c-sharpcorner.com/article/rest-crud-operations-using-sharepoint-hosted-app-office-365-pa...

 

but one drawback i have faced recently, is that the add-in will be rendered in the classic experience, and i can not get the add-in to render using modern experience. now i read about this and many folks mentioned the SharePoint framework appraoch, which can allow us to build modern web parts. but from my experience i use web parts to display information, and i never saw a web part which provide CRUD operations. So if i want to provide CRUD operations in modern experience,  then is building modern web parts using SharePoint framework the way to go?

second question. can we force the SP hosted add-in to render using modern experience ?

 

//Hint. i can not use power apps in my case, as i have external users who need to access the CRUD operations, and currently power apps does not work for external users.

 

Thanks in advance for any help on my above 2 questions.

Regards

 

12 Replies

Hi,

 

When it comes Modern Web Parts and SharePoint Framework it all depends on your requirements and what is needed. If it is basic stuff for CRUD operations maybe it is. 

From my point of view the Modern experience is not ready yet, and it still requires many adjustments to be able to deliver all that we need. 

 

And no, it is not possible to force the Modern Experience with Add-Ins. At least I didn't have seen any solutions to this, or any possibilities. 

 

Currently I am still in need for options to deliver experiences to Modern team sites, but there isn't any.

 

Regards,

 

André


@AndreKrijnen wrote:

Hi,

 

When it comes Modern Web Parts and SharePoint Framework it all depends on your requirements and what is needed. If it is basic stuff for CRUD operations maybe it is. 

From my point of view the Modern experience is not ready yet, and it still requires many adjustments to be able to deliver all that we need. 

 

And no, it is not possible to force the Modern Experience with Add-Ins. At least I didn't have seen any solutions to this, or any possibilities. 

 

Currently I am still in need for options to deliver experiences to Modern team sites, but there isn't any.

 

Regards,

 

André


@AndreKrijnen

Thanks for the reply. so you are saying that currently we can not have advanced CRUD operations inside modern experience (compared to SP Add-ins ) ? even when developing  modern web parts using SP framework ?

I totally disagree here with AndreKrijnen....modern experiences in SPO are totally ready and the recommendation when developing custom functionality for SPO is to go to SPFx or to PowerApps depending on your requirements

@Juan Carlos González Martín wrote:
I totally disagree here with AndreKrijnen....modern experiences in SPO are totally ready and the recommendation when developing custom functionality for SPO is to go to SPFx or to PowerApps depending on your requirements

@Juan Carlos González Martín

I also agree with your point that the SP framework is ready to be used. but to keep my question specific, now in SP online classic experience, when we wanted to build advance CRUD operations, we use to do so using sharepoint hosted add-in, as it is very suitable for this. but SP-hosted add-ins option will not work with modern experience. so what is the official replacement for sharepoint hosted add-in which use SP rest api to implement advance CRUD operation? powerapps OR modern web part built using SP framework? let ignore the fact that powerapps currently can not be used by external users, to have more accurate comparison, as i think in the near future powerapps are supposed to work with external users.

Regards

 

@john john Do you get an answer for your question? Should we go with App model or SP framework can help with CRUD operations given the modern experience it provides? 

@Rishi Gupta @john john Whether you are using modern or classic experience in SPO, the recommendation would be to use SharePoint Framework instead of SharePoint-Hosted Add-Ins. There are many reasons SPFx is preferred over Add-Ins - Performance, ALM/CI/CD support, Web Parts aren't hosted in IFrames and more. https://docs.microsoft.com/en-us/sharepoint/dev/spfx/enterprise-guidance

If you like SharePoint hosted add-ins because you like control of a larger page, or you are building a SPA... You can check out single part app pages https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/single-part-app-pages

 

You can do all the crud operations you want using SharePoint Framework.

Here is an example of doing CRUD operations with SPFx. If you take a look at this repository, you'll see a lot of other community built solutions.
https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/sharepoint-crud

@Beau Cameron Thank you for your response. I am currently looking for solutions wrt SharePoint 2019. We are planning to host a Form in SharePoint which will save the data in a list and then calls REST API from another 3rd party system. The Third party system will talk to SharePoint hosted Form using REST calls and it will be two way communication. The reason I asked this is because in this case Provider Hosted application makes more sense to have greater control on the REST API as the calls will not be made in context to user but a separate account. Let me know if you have other thoughts.

@Rishi Gupta What service/API is it? Generally speaking, APIs may support client credential flows and not just user flows. Is this available to you?

@Beau Cameron The API's are third party custom solution. User might not have access to the 3rd party solution but the application can be accessed using a common account, how we used elevated privileges in the SharePoint solutions.  

@Rishi Gupta Right, so are you connecting to this API using a username and password? (scary) Sounds like you are saying, this API doesn't have support for a Client Credential flow using tokens?

@Beau Cameron  I am not completely sure if the application supports Client Credential flow using tokens. I might need to check with the respective team.

@Rishi Gupta Ya I would check with the people who built the API and see what authentication mechanisms are available to you...