Conditional logic is not working

I’ve built a pretty extensive app and have a great grasp on conditional logic, but why this certain process isn’t working is beyond me. Here’s the deal:

A page “Checkout Intent” is created with a Product as a data type, and the product’s creator is referenced throughout the page. In multiple places throughout the page, calling logic on the “Checkout Intent Page’s Product’s Creator” (basically the seller of the product) works perfectly. But ever since a few days ago when I started adding new buttons the logic has fallen through but only for the new elements.

It’s a simple case. I have a PayPal Checkout button that is initially hidden on page load, and then is set to become visible when “Checkout Page’s Product’s Creator’s PayPal Merchant ID is not empty”.


But when I load the page with a product whose creator has a PayPal Merchant ID connected to their acocunt, the button does not appear.

So my first thought was that maybe the user’s PayPal Merchant ID became empty by accident. But nope! When I click the button (after removing the conditional logic and setting it to visible on page load), it takes me to the PayPal checkout and passes through the correct MerchantID associated with the seller’s account (and I use the same logic to pass this value, the Checkout Intent’s Product’s Creator’s PayPal Merchant ID). So the PayPal Merchant ID for that user is there and correct.

I also checked all the workflows for this page, and there is nothing referencing the visibility of these buttons on the backend.

I am completely lost as to why this logic is not working. Any help is appreciated.

Have you clicked the Inspect button in debug-mode and selected the Paypal button so you can inspect the actual data behind the conditional? Might be insightful.

Yep, when I flip the logic around in order to make the element visible for inspection (visible when PayPal Merchant ID is empty), it says that the condition is met, and shows the button.

So the app thinks that the PayPal Merchant ID is empty, but then it uses that exact PayPal Merchant ID when I click the button so I’m not sure what’s going on.

When you’re inspecting, do you click through each section of this conditional to see where the data might be dropping out?
image

Meaning, click on Current Page Checkout Intent, then click on Product's Creator, then…etc.

Might help pinpoint which section of the data is missing, then you can troubleshoot when and how that data is set.

1 Like

That did the trick, thank you!

Like a goof I didn’t check the privacy rules of the Merchant ID, turns out it’s private so for a regular user it isn’t accessible.

I’ll have to either turn off the privacy or find a way to use the logic without exposing the Merchant ID to regular users.

Thanks!

Ah! Privacy Rules. They’re tricky for sure!
Glad you got it figured out.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.