I've got two lists:
InventoryListOne and InventoryListTwo. In list One I have a column called Id Test with numbers in them, I've created 4 items, so the ID Test numbers run from 1 - 4. In list Two there's a column called DeviceId. On list Two I've created a Worklow and have a Query List item where I query List One and the ID Test column and save it to a variable called Inven_Number. Next I have a Set field value which is set to DeviceID, Equals Workflow Data and then Inven_Number but when I run the Workflow it just updates the DeviceID column to '1' regardless of what the number in ID Test is in list One? What am I doing wrong?
Solved! Go to Solution.
Well it's related. I set up two news lists on our live environment as proof of concept in case it was a problem with our dev site. I'm getting a different result, but still not the right one.
How is your query structured? Typically, a query returns items in a collection variable, which could potentially explain some of the strangeness you're seeing. If you log "Inven_Number" and check the value, you might be able to troubleshoot from there. This will all depend on what are you querying InventoryListOne for (how your query is structured).
On this the variable is set up as a number and on my previous question it's set up as string, so could that be it. Should I set the variable up as Collection Variable?
In your query action, when you pick the variable, if there isn't one already created, you should have the option to create a new one. If you do it that way, it default picks the variable type that is most useful/common/relevant. If you do that, what type of variable does it try to create? A collection variable?
It was initially set to text, so I changed it to number, with default set at 0 but it's still not updating.the default of the column it's updating is also set at 0.
On Configure Action I've got Where set to DeviceID, Equals set to Value and 0 Field set to DeviceID Equals Workflow Data and the variable id_number. I'm going to try setting up the variable to be a collection and see if that makes a difference
I set up a Collection Variable but by the time I get to the Update item or the Set Field Value the drop down is not giving me that variable? Also would I be right in thinking if you disable an action that the Workflow wont run through it. The best I'm getting back is still "1".
Correct, if you disable the action the Workflow should not execute it, it should just skip over it.
So, these are two separate lists. List A and List B. List A has column X and List B has column Y. You want to copy the contents of List A column X to List B column Y, right? How do you pick the item in List A? As in, what criteria does it need to fit to be sure it's the item you want? For List B, same question?
Here's an example to see if I can illuminate this a bit more:
I have List A of Devices with column X which holds the device name (laptop, mobile phone, etc). List A also has Column W, which holds an "ID" for that device type (1, 2, 3). These IDs are unique to each device name. List B is inventory of what users have what devices and I want to get the ID from List A to put with the device. So I have this:
I want the workflow to put the ID that correlates to each device name into List B. Here's how I do that on a workflow that runs on List B on item creation:
Field: The field of the current item in List B (the one the workflow is running on ) that I want to update. I want to update the ID column
Value: Ok, here's where I lookup to the other list to see what ID I want. So the source is List A, because that's where the info I want lives. The field I want to copy out of is ID. Now, how does it know which item ID I want? Well, I want the one that matches the device name I'm using. So, I say where "Device Name" equals the Device Name of my current Item.
After I run the workflow, I should end up with this:
Does this make any sense? You may not need a query list action at all.
Here's my first list: Devices:
The number in the ID Column is an automatically generated number.
Here's my second list Knownissues:
The DeviceID column is the one I want to update with the Workflow. Currently it's a Number column with the default value at 0.
Here's my Workflow. I swap between the Set field value and Update item action to try and get the DeviceID column to update:
I've set the Query List to look at the Devices list. I've selected the ID column and stored it in a number variable called id_number:
I've then set the Update Item to update Known Issues where DeviceID value is 0. I've selected the DeviceID and Equals to bring back the id_number variable. The Workflow settings are set to run automatically but when I add an item to the KnownIssues list the number in DeviceID doesn't update when the Workflow completes. I can't see where I'm going wrong?