Sharepoint 2013 workflow update all items in dictionary -


is possible build dictionary, , perform actual action (such set field value) on every item in dictionary?

the objective - have list lets say"test list" (for simplicity let's has 4 columns) , running workflow on item 1

example "test list"

now when cost field updated on item id 1, lookup cost change items id 3 & 5, calculated fields in 3 & 5 not update until items modified in way.

solution far - have done create string variable "domain/site/_api/web/lists('test list')/items?$filter=lookup on id eq '([%currentitem:id)'

to create call "domain/site/_api/web/lists('test list')/items?$filter=lookup on id eq '1'

which when count returns 2 items. build dictionary these 2 items

the problem - have seen many posts showing how can iterate through dictionary values out of it, , log them in variable can use in log history or send email. want items in dictionary such set 5th column "say date modified" today in order update calculated field.

once dictionary built, possible instance loop count dictionary items (which equal 2 in case, have achieved)


first loop next id dictionary > (3) update column 5 today's date(just example doesn't have date make update), in item id (3)

second loop next id dictionary > (5) update column 5 today's date in item id (5)


i have thought doing through update item in loop, or if lookup id = currentitem:id have stumbled problems there. raised question around using "if" , "update item" different question , useful learn if either method possible , how perform each method separately. if solve using update or if, please find question below

https://sharepoint.stackexchange.com/questions/187618/sharepoint-2013-workflow-update-all-items-with-value-using-if-or-update

thanks in advanced

so ended answering own question. it's polite add answer here (so simple once re read wrote here)

so first thing want create loop using call http web services, can find lots of examples of how this. such http://weblogs.asp.net/ricardoperes/looping-through-list-items-in-sharepoint-2013

so in list lets @ 3 columns

id - lookupid - updated (in image below, field "text3" updated column)

now in first step want add filter when creating url variable, takes id of item running workflow , finds items have said id in lookupid column. example below

https: //domain/site/_api/web/lists/getbytitle('testlist')/items?$filter=lookupid eq '[%current item:id%]' (remove space between https: , //)

then follow instructions above site until section "get fields" inside loop

my workflow

i stuck because couldn't find command act on items in dictionary, realised, can create variable contain id (that change each time item loops) of each item workflow loops through , after can create update action id variable in list , update field.

as can see have 2 update fields (the second 1 sets text3 second update, testing purposes) kept wasn't sure if update update item if contained value.

a big stack exchange questions , answers lead me along path solution.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -