How can I update an item in a column of a different list?

  • 19 August 2016
  • 9 replies
  • 1 view

Badge +3

Hey Everyone,

My workflow should be fairly simple but for some reason I can't get it to work. This is what it looks like:

2016-08-18_16-25-39.jpg

Workflow logic:

  • 2 lists: "Orders" and "Quotes & Invoices"
  • I created a column in the "Orders" list called "Quotes". This is what I want updated.
  • The list workflow is on the Quotes & Invoices, where it Queries List for Quotes, collects Quotes and current Order:

2016-08-18_16-29-33.jpg

  • I used For Each:

2016-08-18_16-31-33.jpg

  • The Build String to set item title:

2016-08-18_16-32-48.jpg

  • Finally, I Update Item as follows:

2016-08-18_16-34-09.jpg

Whenever I edit the item to start the workflow I receive an error when updating item with no further details.

Appreciate any help.


9 replies

Badge +10

Hi MK,

In query list, the order is stored in string variable (as you mentioned String_CurrentOrder), i think you should store it in a collection variable and use collection operation in foreach loop to get the value in each row.

Badge +7

Hi MK,

1.  I will save the ID of the list item in the coll_QuotesforOrder collection.  And only that in the first Query List action.

2.  I will add another query list within the for each loop and then get the values for name and order linked to the current id...so filter on ID = string_QuotesforOrder

3.  I think the build string should be fine but to make sure while testing write it away to a log in history action.

4.  I will add the update action within the for each loop and update where ID = string_QuotesforOrder and not outside the for loop as you have it currently.  So basically this way you will update line by line.

Please let me know if this helped or if any of my steps are unclear.

Badge +3

Hi Francois,

Thanks for the reply.

Question please: in the 2nd QL, do I add the name and order fields in 2 different variables? and should they both be Collections?

Badge +7

Hi M K,

I would add each field in its own String_variable just like you did in your workflow.  You can use the existing variables that you have (Name and Order)

The thing is that the for each loop will overwrite these values in every loop and that's also why I suggest you add the update action inside the for loop so that you write away the values in the variables against the current ID and then get the next set of variables in the next loop and so on and so on.

Let me know if you have further issues or questions.

Badge +3

I keep getting this error for some reason: “Coercion Failed: Unable to transform the input lookup data into the requested type.”

Mariam Kabesh

Event Coordinator

+1 (250) 479-3638, 111

1-888-210-7420

www.SSI-corporate.com<http://www.ssi-corporate.com/>

Badge +7

Hi Mariam,

This is usually because you are updating a field of a certain type into something of a different type, i.e. String into a number or date field.

Can you perhaps send screenshots of the list settings for the list that your updating to?

Badge +3

Hi Francois,

Are you referring to the SharePoint list?

Mariam Kabesh

Event Coordinator

+1 (250) 479-3638, 111

1-888-210-7420

www.SSI-corporate.com<http://www.ssi-corporate.com/>

Userlevel 7
Badge +11

Firstly, in your For Each, you're overwriting the string_DocTitle.

Are you trying to update each quote?  If so, you should put your Update Item action inside the For Each.

Also, when you get an error like this, if there's nothing obvious in the workflow history, look in your SP logs.

Finally, instead of using variable, just to see if it works, trying hardcoding the values into the Update Item action and see if that works.

If it does, compare it to the values in your variables and see what the difference is.

cheers,

Vadim

Badge +11

From what I see, it looks like the Order column will always be the same since you are querying it on that too. I may be misunderstanding. But it needs to be a collection and not a string. Also, when you do the update I'd search on the ID. I'd update one by one and then Commit Pending Changes after each one.

Reply