cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

"Object reference not set to an instance of an object." when trying to "Create item in another site" with VARIABLE site URL.

So, the "Create item in another site" action works GREAT for me when I have a static, explicit URL. I can create items all day long with no issue.

BUT, I need to create items where I don't know the site until run time.  The action allows a reference to be used for the Site URL.  So I pull in the URL from a Workflow Variable.  When I click Refresh, it pops up a dialog box saying: "The Site URL contains reference tags. Please manually replace any remaining tags."

Ok, I say to myself, that makes sense, it needs a real site to look at so it can populate the List dropdown. No worries, since any site I'm going to give it will have the same lists/libraries.  I give it an explicit site URL, click ok, and the List dropdown refreshes.  I pick the Shared Documents library, pick the Content Type, set the Name field, and save. Publish the workflow.

When I run it I get the dreaded "Object reference not set to an instance of an object." error.

What am I missing here?  (See below for a screenshot of the action's configuration.)

Labels: (2)
0 Kudos
Reply
1 Reply
cju
Nintex Newbie

Re: "Object reference not set to an instance of an object." when trying to "Create item in another site" with VARIABLE site URL.

You're right, this action is great when you have a static URL. Actually when you select a list on the dropdown, the id of the selected list is stored and used at the execution. When you execute the workflow, if the list in the other site doesn't have the same id than the one you selected for the configuration, then you get the error you have.

To achieve the creation of an item in another site, I use REST API requests. I wrote a blog on this which can help you building actions :

How to execute a REST API request with Nintex Workflow

You can also call lists.asmx SharePoint web service but I prefer REST API.

Hope it helps

0 Kudos
Reply