1

I have one SharePoint On-Premises site which is accessible outside of my server. I already have few lists & libraries created on that site which I am using.

I have one Office 365 SharePoint subscription where I am using some modern inbuilt as well as custom web-parts.

In one of my Web-part, I have a form & I want data from SP On-Premises lists (E.G. Countries, Cities, etc.) to bind into drop-down available in SPFx form. I also want to post (save) form data to SharePoint On-Premises list (e.g. Customer Information).

Kindly help me by providing detailed information about How can I perform my operations.

I am using only SPFx solution so Kindly provide me the solution for my SPFx solution only.

1
+100

You can design an Azure function or self-hosting web service that will connect to SP On-prem and get or post data from/to a list. Use the web service in your SPFx web part. If you need to authorize a user making a call to the function, register an Azure AD App and enable authorization for your Function App as described here.

| improve this answer | |
  • Thanks for your response. Can we directly do something with SPFx webpart to achieve the same? like REST API or any other way? – Hardik Sep 5 '19 at 9:11
  • Kindly provide me simple & another way to achieve it. – Hardik Sep 5 '19 at 10:51
  • Create 2 Microsoft flow, One for bulk operation(which will create the record in SharePoint online from the record available in SharePoint on-prem list like Countries, Cities). The second one will trigger whenever any changes made in SharePoint online list. After that, you only need an SPFx form. ;) – Utkarsh Dubey Sep 11 '19 at 10:33
  • Thanks Dmitry to provide me an idea. – Hardik Sep 16 '19 at 11:56
0

I have created one Web API to get/post data using SharePoint On-premises.

I have used EnableCors in ApiController to avoid CORS related cross domain error while accessing the Web API through SPFx webpart.

I have used simple Ajax call to get/post data by calling different functions & passing the parameters to my few functions.

I have hosted my Web API to local IIS & provided one end point URL so I can use same for further use.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.