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
SFSF 

Flow not updating checkbox on opp based on product value

I have created a flow where if the product field Product type changed then update the event check box on opp.
I created a record trigger flow if the product field Product type changed then update a check box on opp. This is working but not always, most of the time there is no update, and there is no pattern to pinpoint the issue to.

 The trigger is when the Product's product type(text field) is changed.
 User-added image
 
next, I use the get record element to get the opp line item as this object is on Opp related list and has a Product attached to it.
 User-added image
the decision is used next to check if the Product type(text field) contain "Delivery Fee" 
 User-added image
if yes then Get opp and check the check box(image below) if not uncheck it.
 User-added image
 
this is the object Opp Product(OppLineItem) which I am using to get to the right Opp from the product. As this has a Product lookup field.
User-added image
 
 
I am unable to understand where I am going wrong, I don't have any Failed Interviews and there is no error in the debug log too. Please help!
Thanks in advance!
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

You are getting only one record in get record of Opportunity product but there will be more than one opportunity product for a product because of which you are facing the issue.

You should get all the records in get record element and iterate through for loop and do the remaining operation.

Also you can but the other filter in start element only instead of adding decision box next to get record element.

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,