I have a web screen withe button to calcluate something and present it on screen.
I want that after 7 times the user cliked, presenting the recaptcha.
I have the logic for counting the times the user cliked, In the action on click of the button I have the condition in the image attached.
My question is how can I use this in my application?
Do you have some example?

Also I have the site key and the secret key of my site that I registered in google.

It would be better to not do a redirect. Instead, put the captcha in an IF widget on the screen (tied to the number of failures), and each time it fails, refresh that IF. After it gets past 7, show the captcha.

Also, I would NOT use a session variable for this, I would use a screen variable. If someone fails 5 times then gets it right, goes to another screen, then comes back here, 2 failures shouldn't show them the captcha.

Just a side note, I don't believe that you can render the recaptcha widget after initial screen load.

I had to show/hide the recaptcha widget based on a drop down value (as a preview of what the type of spam protection the user was selecting) and had to render recaptcha and recaptcha 2.0 on screen load. Then show/hide using js or the display on the divs.