2

I am new to developing apps in Visual Studio for SP. I have a problem to use the standard functions for creating a workflow. Currently I need the workflow action Set field in current item, but I don't know where to find this action. Which action in VS is the replacement for that action? I was trying to use the Update list item action too, but it asks me for a C# expression, how to write the placeholders for the columns?

2

Yes you can use the UpdateListItem activity.

In the ListItemPropertiesDynamicValue property you need to set the Path and the Value. In Path select the field you want to update. In Value enter the value you want the field to be.

So, for example, if you want a field called Status - which is a Single Line of Text field - to be set to "In Progress" it would look something like this:

enter image description here

If the field you want to update was a Number field, then you would simply enter a number in Value.

But remember in the Value field you can also enter the name of a workflow variable, if you've defined any.

Update:

It seems you're asking how to assign a workflow variable to the workflow item's ID.

First you need the item ID. Use the GetCurrentItemId activity:

enter image description here

In this activity's properties set the Result property to a workflow variable of your choice, I've created one called itemId:

enter image description here

Then you need the Assign activity:

enter image description here

And set its properties like so:

enter image description here

WorkflowID will be assigned to the value of itemId.

  • Thank you for your answer. I found that way, but I don't know how to put in the Value field a placeholder. For example. I need to set in one column the ID of the item. In SPD I would use the Set field in current item action and set MyField to CurrentItem:ID. – Senad Feb 8 '16 at 15:53
  • Are you saying you have a workflow variable called MyField or something else and you want to take the value of this workflow variable and use it to set the value of a column in your list item? If so, in the Value field in the screenshot above just enter the name of your variable. – Submits Feb 8 '16 at 16:02
  • For my example I need to set the ID of the item to the field "MyField". On your screenshot MyField should be in the Path column and the ID of the item should be in the Value column. – Senad Feb 9 '16 at 8:41
  • That's correct. But, do you know that the ID column of a list item is read only? You can't update it. – Submits Feb 9 '16 at 10:04
  • Sorry for misunderstandings, I need the opposite. Here is a screenshot from SPD from the action that I need. imgur.com/thxyA0C – Senad Feb 9 '16 at 13:17

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.