cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Does an action (or actions) exist in Nintex Workflow to copy a file from Nintex SharePoint 2013 on-premise to a SharePoint online tenant which also has Nintex workflow online enabled?

Jump to solution

Hi,

I have a customer requirement to copy a file from a SharePoint 2013 on-premise instance to a SharePoint online instance, both installed with Nintex Workflow Enterprise.

The file should be copied complete with metadata but version history is not required.

I'm wondering what Nintex actions support such a scenario? Or if it is more custom but still quite feasible?

Thanks,

Sean

Tags (1)
0 Kudos
Reply
4 Replies
Highlighted
Automation Master
Automation Master

Re: Does an action (or actions) exist in Nintex Workflow to copy a file from Nintex SharePoint 2013 on-premise to a SharePoint online tenant which also has Nintex workflow online enabled?

Jump to solution

No, but I would try to do that this way:

  1. Configure your on-premise workflow to be able to be triggered by the external start.
  2. Then create your O365 workflow where you obtain rtFa and FedAuth cookies (https://community.nintex.com/community/build-your-own/nintex-for-office-365/blog/2017/02/09/working-...)
  3. and then call the on-premise workflow passing the cookies values together with ex. path to a library where you want your file to be uploaded.
  4. In on-premise workflow, that will be triggered externally, get the cookies and add the action to call web service.
  5. You will then have to configure the action to call your O365 REST API:
    1. https://msdn.microsoft.com/en-us/library/office/dn769086.aspx
    2. https://msdn.microsoft.com/en-us/library/office/dn292553.aspx#Anchor_1
    3. You should be able to use your cookies instead of "X-RequestDigest" in your request header. To do that create a variable: "cookie" and set its value to: "FedAuth={value};rtFa={value}"
  6. The action should be configured this way:
    1. Headers:
      1. accept: application/json;odata=verbose
      2. cookie: FedAuth={value};rtFa={value}
    2. Body:
      1. Binary contents of your file

Regards,

Tomasz

Reply
Highlighted
Nintex Newbie

Re: Does an action (or actions) exist in Nintex Workflow to copy a file from Nintex SharePoint 2013 on-premise to a SharePoint online tenant which also has Nintex workflow online enabled?

Jump to solution

Thanks Tomasz, looks very complex!

I can see how the binary of the file is passed this way, how would you pass metadata using something similar?

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Does an action (or actions) exist in Nintex Workflow to copy a file from Nintex SharePoint 2013 on-premise to a SharePoint online tenant which also has Nintex workflow online enabled?

Jump to solution

I know... But at the moment nothing simpler comes to my mind. I mean - I would try to go that way. Imho it should work and do what you expect even though its complex.

On the other hand as long as you are on premises you can always ask a developer to write you your own, specialized and dedicated action for Nintex Workflow 2013, that will receive some params and uploads your file. But in the end this action will be just a prettier representation of what I wrote above

Back to the metadata - as that method allows only file contents to be passed in the request body, I'd hit with another web service call now to the list REST API to update the item you have just created and to set its library properties, ex.:

method: POST
body: { '__metadata': { 'type': 'SP.List' }, 'Description': 'My list description', 'Title': 'Test', 'OtherInternalName': 'OtherValue' }‍‍

Source: https://msdn.microsoft.com/en-us/library/office/dn292552.aspx#Anchor_2

One more thing - you don't need to start your logic from O365. Following steps to obtain FedAuth and rtFa cookies you will notice that the first step is to send "SAML Request" - you can do it from on premise workflow, providing your "onmicrosoft" login and password. So in the end you can simplify it a bit:

  1. Use https://community.nintex.com/community/build-your-own/nintex-for-office-365/blog/2017/02/09/working-... to get the cookies for O365 tenant following steps from your on premise workflow;
  2. Set action to call O365 library REST API as I wrote above so that it will upload your file;
  3. Set action to call O365 library (list) REST API again to set created file metadata.

Done!

Regards,

Tomasz

Reply
Highlighted
Automation Master
Automation Master

Re: Does an action (or actions) exist in Nintex Workflow to copy a file from Nintex SharePoint 2013 on-premise to a SharePoint online tenant which also has Nintex workflow online enabled?

Jump to solution

Sean Swords‌ have you solved that issue? Can you mark the question as "Answered" (to do that you mast mark one from the answers as "Correct"), or do you need more support?

Regards,

Tomasz

View solution in original post

0 Kudos
Reply