Access process variable from link or button

Hi guys :slight_smile:
maybe you can help me.
i have a process variable called “bookURL” with the site url of one book (http://www… etc).
i want to show a link or a button in one form so when the user click them, he will be redirected to the site, but i cannot do it.
If i show the variable in one input, everything is ok … but, i dont know how to put that variable in one “link” or “button” as a external link.

Thanks!

1 Like

Just create a Custom Widget that will execute a window.open(http://mylocation) in JavaScript.

regards
Seán

PS: As this reply answers your question, please mark as resolved by ticking the tick mark on the left of this reply.

Hi Mauro,
I would say, first you need to get your process variable onto your form. You can do it via the API (I made a custom widget for that http://community.bonitasoft.com/project/get-activity-variables).

Then you can either use the above mentioned widget of bpms.help or include the code into your link (by using the link/http widget) and input something like this

<a href="{{ caseVariables['bookURL'] }}" target="_blank">Check out this great book</a>

Hope it helps…
Valerio

If you don’t know how to do it, you can download such widget from my site. It allows to execute any JavaScript function: http://bpms.help/download.php

Best regards,
bpms.help

thanks contact_420 !

Valerio, you are the best :slight_smile:
thank you!

You are welcome! :slight_smile: