Taking credits from a user

Hey guys,

I’m trying to overhaul my credit system but keep running into the same problem. Here’s how I have it set up now:

Every 3 seconds look for a request where data field A is empty. If that’s the case, get data from an API and change data field A to the results for that API call. Then, take 1 credit from the user and change this requests ‘credit taken’ to ‘yes’.

Then this is in that same workflow, taking the credit from the user. However the ‘only when’ doesn’t seem to function. It keeps taking a credit from the user even when ‘credit taken’ is set to ‘yes’.

Any ideas what I might be doing wrong?

Hi @hansdekk !
Can you please show a print of the workflow action where you set the “Credit taken” ?

image

1 Like

1 Like

Thanks for the screenshots, so you’re saying that the record gets changed to “credit_taken=yes” successfully ? Have you checked in the backend ?

image

1 Like

Okay, when I get problems like this what I do is use the debug functionality and step through the workflow that is giving me issues.

To do that, make sure you have ?debug_mode=true at the end of your page url, then, click on the button that says Step-By-Step
image

Because your workflow runs every 3 seconds, it will eventually come up in the debugger, like this:

Then, for each action you can actually check what the values for the conditions you’ve set are, just click on the blue condition:

Please tell me if you need further help :smiley: