Parent Object - Opportunity

Child Object - Opportunity Product

I have a field for each product on the Opportunity. For example if Opportunity Products X and Y were added to the Opportunity as Opportunity Products on Opportunity fields would state :

Product X=1

PRoduct Y=1

1 indicated products was purchased.

I need to create a formula field that would look up each product's field and if the field is 1 return the name of the product and do it in a string. The issue is if multiple products were purchased the string should return all.

Example Product X=1 Product Y=1 Product Z=0 Products W=0

New field Products Purchased = X,Y

I tried to achieve this with IF formulas, but as soon as it evaluated to true it stops checking for other Products. I thought of using the Case formula, but as I understand it works only with retuning numbers.

this is what I have so far, but no idea how to combine it

IF ( Opportunity__r.Product_X >0,"X",

IF( Opportunity__r.Product_Y >0,"Y",

IF( Opportunity__r.Product_Z >0,"Z",



  • What you are asking for is a concatenation operation across n OpportunityLineItem. Rather than have separate fields on Opportunity for each product, use DLRS to rollup the concatenation for you
    – cropredy
    Jun 8, 2021 at 16:47
  • A formula field on a parent object cannot pull data from child records. As cropredy suggests, you'll need a rollup tool. Also, are you really going to have a separate rollup field for every Product? That's not scalable. Jun 11, 2021 at 19:53


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.