Opposed worfklow actions not being checked and run

Hello (and Happy New Year),

I am building a clickable button next to the detail page of one product (among many products).

This button displays the total users upvotes count for this specfic product.

The idea is the following :

  • When the user upvotes the product for the first time, the total product users upvote count should increase by one.

  • When the same user upvotes the same product for a second time, the total product users upvote count should decrease by one.

The pdf link below containing 5 screenshots (screenshot #1, screenshot #2, screenshot #3, screenshot #4, screenshot #5) sums up my work.

My idea was to create the data type Vote containing the fields (1) Product and (2) User.

Every time a user clicks on the upvote button, my workflow contains 2 posssible actions :

  • If the Vote row entry containing the specific product and user is not found, both a new row entry is made in the Vote data type and the total product votes count in the Product data type votes field increases by one.

  • If the Vote row entry containing the specific product and user is found, the total product votes count in the Product data type votes field decreases by one.

The problem I am a facing is that the total product votes count only keeps on increasing.

It is as if only the first workflow action (“increase votes by 1”) is being checked and performed and never the second workflow action (“decrease votes by 1”).

Any help would be greatly appreciated.

Thanks a lot.

K.

Copy paste that Only when condition on the actual workflow itself. Delete it on the actions. then copy paste the actual workflow, then modify one of them so it’s the opposite condition, then delete the actions on each you don’t want to run.

More reliable if the two workflows are checked separately instead of running the workflow and having it check both actions.

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