function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HNT_NeoHNT_Neo 

Custom formula on Child Object with values on Parent and child object

Hello, 

Trying to figure out this formula where the end result populates a text field named: Task_Owner__c
IF Response__c = Sel1, value from User1__c should save to Task_Owner__c field


IF Response__c = Sel2, value from User2__c should save to Task_Owner__c field


I included this diagram to hopefully explain what i'm looking for. 
User-added image
The formula syntax will reside in the Task_Owner__c formula field. 

 
Best Answer chosen by HNT_Neo
DeepthiDeepthi (Salesforce Developers) 
Hi JH_Neo,

Check the below formula:
IF( ISPICKVAL(Response__c , 'Sel1') ,  object1__r.User1__c  , (IF(ISPICKVAL(Response__c , 'Sel2'),object1__r.User2__c, NULL)))

Hope this helps you!
Best Regards,
Deepthi

All Answers

DeepthiDeepthi (Salesforce Developers) 
Hi JH_Neo,

Check the below formula:
IF( ISPICKVAL(Response__c , 'Sel1') ,  object1__r.User1__c  , (IF(ISPICKVAL(Response__c , 'Sel2'),object1__r.User2__c, NULL)))

Hope this helps you!
Best Regards,
Deepthi
This was selected as the best answer
HNT_NeoHNT_Neo
Thank you Deepthi!

This worked and modified the user ID output to Name: 
 
IF(ISPICKVAL(Response__c , 'Sel1'), 
object1__r.User1__r.FirstName & " " & object1__r.User1__r.LastName, 
(IF(ISPICKVAL(Response__c , 'Sel2'), 
object1__r.User2__r.FirstName & " " & object1__r.User2__r.LastName, 
NULL)
)