Is is possible to populate lookup field using Workflow or Process builder? I want to populate the lookup field based on the value of another field which is not lookup.
-
What kind of data does this other field hold?– Adrian Larson ♦Commented Oct 1, 2015 at 6:50
-
Hi @AdrianLarson, this other field is a text field which will be same as Lookup object records "Name" field value.– Rohit PatilCommented Oct 1, 2015 at 7:15
-
If you are using data loader that is standard functionality. You need to clarify expected behavior when there are multiple matches or no matches.– Adrian Larson ♦Commented Oct 1, 2015 at 7:38
2 Answers
I think the easiest way to do this is to use a headless Flow triggered by the Process Builder as in a Flow you can assign a text string to a picklist or as I have done with 2 picklists on different objects where I have used a variable to take the value from one to copy it to the other.
You can use Process builder to update lookup fields The Action to set new fields should be of type Reference.
Example: Field: Case [a lookup to case on customObject customObject__c]
Type: Reference
Value: the field on customObject
-
Hi @Shruthi,thanks for your reply. I tried with Process builder but you can select only lookup field as value. I want to select lookup record based on non lookup field value. Commented Oct 1, 2015 at 8:56
-
I am afraid you can solve this only via code. Either use before trigger or apex invocable method in process builder.– ShruthiCommented Oct 5, 2015 at 2:27