Update a field in a list according to another lookup field in the list
-
mercredi 13 juin 2012 08:58
Hi all,
I'm trying to update a field in a list according to other field value. Let me explain:
List A - "Budgets" - has a "Title" and a "Number" column
List B - "POs" - has a "Budget" (lookup column to A's list title column) and a "Number" column
When someone will add an item to POs list (B) and will choose the budget, I want the Number column will automatically update according to the values in list A.
Can someone help me with that please?
Thank you so much!
Toutes les réponses
-
mercredi 13 juin 2012 09:15
You can do this using SharePoint Designer Workflow with "Set field" action, refer to the following post
http://office.microsoft.com/en-us/sharepoint-designer-help/use-variables-in-workflows-HA010240415.aspx
--Cheers
-
mercredi 13 juin 2012 09:45
Hi Prasath!
Thank you for your comment.
Iv'e done the following but I'm getting an error:
Set (List B)field:"Number" to value: Data Source: (list A - Budgets) > field from source: Number > field: Title > Value: CurrentItem:Budget.
What is wrong here? I cant figure it out..
Thanks!
-
mercredi 13 juin 2012 09:57
You can also try to achieve this at the list form level by auto populating the values.
Refer to the following post
http://social.msdn.microsoft.com/forums/en-us/sharepointcustomization/thread/1777BCE9-0A8F-4DDD-B82C-6294809245F7
--Cheers
-
jeudi 14 juin 2012 10:36
Sorry Prasath I just cant figure it out. I dont want to use javascript for it because I dont need the user to see those fields when he adds the list item.
I just cant figure out the logics behind the lookup process that is made by the "set field.." action. Can you explain maybe what is the meaning of each of those fields?:
Thanks a lot,
Lena.
-
vendredi 15 juin 2012 09:51Modérateur
Hi Lena,
The Lookup type column "Budget" (e.g. format as 1;#abc) in listB cannot be compared to the column "Title" (e.g. format as abc) in ListA directly when you use the SharePoint Designer 2010, so you need to use action "Extract Substring from Index of String" (starting at 4) to extract the abc from 1;#abc and output the value to a workflow variable (e.g. substring), then compare this variable substring to column "Title" value of ListA in the action "set field..." .
Image below contains 2 actions, "Extract Substring from Index of String" and "Set Field in Current Item", you need to change the fields as yours,
Thanks
Daniel Yang
TechNet Community Support
- Modifié Daniel YangMicrosoft Contingent Staff, Moderator vendredi 15 juin 2012 09:52
- Marqué comme réponse Daniel YangMicrosoft Contingent Staff, Moderator lundi 25 juin 2012 02:57
-
dimanche 17 juin 2012 10:46
Hi,
Daniel thanks for ypur reply but it wasnt the problem.
I've re-created the WF and it has no errors, I've set veriable to the number I need (lookup is set to List A as data source, field from source is the "Number" [single line of text] column, the field which identifies the item is the "Title" and the value is CurrentItem:Number, as string) and defined to set the field to that veriable but the "Number" column which i'm trying to populate just stays empty. I'm pretty sure the lookup query is OK.
Any idea?? I'm frustrated:(
Thanks,
Lena
-
lundi 18 juin 2012 09:34Modérateur
Hi Lena,
Assume that you have extract the value from the column Budget of POs and output to a Workflow Variable(e.g. named as substring) via the action "Extract Substring from Index of String".
"the field which identifies the item is the "Title" and the value is CurrentItem:Number, as string) " should be not correct, the value should be set as Workflow Variables "substring".
Thanks
Daniel Yang
TechNet Community Support
- Marqué comme réponse Daniel YangMicrosoft Contingent Staff, Moderator lundi 25 juin 2012 02:58

