I have a request to archive SharePoint library (InfoPathform) items to a SQL database using Nintex workflow. Is there a way to use “Execute SQL” workflow action to write data from a library to SQL database? Currently on Nintex 2013 and SharePoint on Prem. Any help on how I can accomplish this will be helpful. Thanks for your help in advance!
Solved! Go to Solution.
If it is just the metadata, definitely you can use EXECUTE SQL action. All you need is a query like this:
INSERT INTO Table1
(Column1, column 2, column 3)
VALUES(
'{WorkflowVariable:val1}',
'{WorkflowVariable:val2}',
'{WorkflowVariable:val3}'
);
If you want the actual forms themselves copied to the SQL database as BLOBs, then I am not sure. I do not think you can achieve that with Execute SQL action.
Let us know.
Instead sending them to sql , you could send them to another library.
Thanks Adavi that worked!
However I need to mover over 168 fields. Is there a way to do a bulk insert using an XML file?
Thanks for your help!
I personally have not done this, but looks like you could do it: Scripts to use XML to insert and update rows in a SQL Server table
I am not a developer and I could not find good instructions on how to use "Execute SQL", so bare with me.
Can I use references instead of variables?
INSERT INTO Table1
(Column1, column 2, column 3)
VALUES(
'{ItemProperty:Store}',
'{ItemProperty:ReasonCode}',
'{ItemProperty:AlarmReceived}'
);
Emily,
Yes, that should work. You should be able to use the references or variables.