Update List Item clarification

  • 20 September 2022
  • 5 replies
  • 78 views

While using the tool for upgrading, I'm referring to the "How to" documentation for the current item context. Specifically in use with Update List Item action.

 

I need clarification on two things:

1) It says the condition should be set to List Item ID is equal to integer Start Event Variable ID

I didn't have a Start Event Variable called ID, so I created one. I don't have another action setting the variable to a value though, how will that work? I might be mis-understanding the documentation.

 

2) It mentions having an ouput variable, can someone provide a little more context in how I would use the output variable when updating a list item?

 

Any insight is greatly appreciated

Thanks


5 replies

Userlevel 3
Badge +8

Hi @ckatz,


 


Your start even variable should be created by default in the start event section under Variables (you will have to use this ID as it is the unique ID pulled from each item in SharePoint):



 


If you do not see the start variables or the start variable object, please make sure your start event/ start action is configured:



 


In your condition builder, it should automatically pull your SharePoint columns (please also make sure that your update item action has all the required fields filled in before doing the conditions):



You don't need to put an output variable for updating items (am not sure what scenario would require the use of an output variable, but good to know the options there lol)


 


Hope this helps


 


Kind Regards


Prineel

Hello @Prineel_V3 ,


 


Thank You for the quick response!


 


How would this work if you have a component workflow, that's why I don't have any of the Start Event Variables (I think). Sorry I didn't mention that initially, I went back in to follow your directions and realized this workflow is a component workflow.


 


Thanks

Userlevel 3
Badge +8

Hi @ckatz ,


 


You will need to pass the item ID from your main workflow into your component workflow:
In your component workflow, on the start action/event, there is a create variable button which you can use to create input variables for your main workflow:



I recommend creating an int variable for your ID, if you create a text variable, you will need to convert it to an int in your component workflow.


 


Re-open/refresh your main workflow and go to your call a workflow step, you will be able to see those input variables and set them from your main workflow:



So where I have intItemID, I used my SharePoint start event ID variable from my main workflow, which then gets passed to my component workflow.


You can use this to pass any other data as well to your component workflow in NWC.


 


Kind Regards


Prineel

Userlevel 2
Badge +5

Hi @ckatz ,


You may want to convert your workflow to use a SharePoint online start event rather than a component start event. Doing this will allow you to access list item data from the start event variables. Take a look at this article for more information: Start Manually Workflow Upgrade Workaround - Item Modified 


Thanks,


Andrea

Thank you - we'll look into this option

Reply