Question
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-10/3f8af45b-0699-44cf-99d1-f67adfea8e52.jpg?h=87136cbf&itok=qwgv_8EL)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-10/3f8af45b-0699-44cf-99d1-f67adfea8e52.jpg?h=87136cbf&itok=qwgv_8EL)
Instellars
SG
Last activity: 4 Feb 2019 7:53 EST
How to call an activity in HTML fragment rule ?
How to call an activity in HTML fragment rule by using HTML tag ?
***Updated by moderator: Lochan to update platform capability***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-11/46daa9d6-f3fb-42ad-b6a5-95eecc782bf3.jpg?h=bda26cd1&itok=sy_eLS1O)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-11/46daa9d6-f3fb-42ad-b6a5-95eecc782bf3.jpg?h=bda26cd1&itok=sy_eLS1O)
Areteans
AU
Hi Srikanth,
In HTML, you can execute an activity using script tags with oSafeURL as given below:
<script type=text/javascript>
var oSafeURL = new SafeURL();
oSafeURL.put("pyActivity","Assign-Worklist.ProcessAssignment");
oSafeURL.put("ClassName", "Assign-Worklist");
oSafeURL.put("InsHandle",param);
return oSafeURL;---this will return only true or false based on execution
</script>
Hope this helps you.
Thanks,
Divya Sri Padarthy
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
OCBC Bank
MY
Hi Divya,
How can i pass parameters from HTML fragment while call the activity. For example, i have used two input fields in a form and i want to pass the values to the calling activity. The activity accept 2 parameters. How should i pass through the HTML fragment.
Note: I want to call the activity on a button click in the HTML Fragment(Please refer the code below). Please find a sample code where i want to apply
<!DOCTYPE html>
<html>
<body>
<h2>Grouping Form Data with Fieldset</h2>
<form>
<fieldset>
<legend>Personal information:</legend>
First name:<br>
<input type="text" class="inputBox" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" class="inputBox" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit" onClick="createUser()">
</fieldset>
</form>
</body>
</html>
Thank you
Riyaz
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689954000/ea0db37c-0cf3-4f6a-90e5-7fa31ed4f3cf.jpg?itok=pvfvIWNy)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689954000/ea0db37c-0cf3-4f6a-90e5-7fa31ed4f3cf.jpg?itok=pvfvIWNy)
Vodafone
IN
Hello Srikanth,
You can use the javascript code recommended by Divya sri above in OOTB HTML fragment - Userworkform inside a function which can be reusable or easy to call the javascript function where ever you need.
-
Ravi Kumar Pisupati
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689954000/f7151e69-7bd9-4702-be03-ebb6f0beb05f.jpg?itok=GWX3Wdig)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689954000/f7151e69-7bd9-4702-be03-ebb6f0beb05f.jpg?itok=GWX3Wdig)
CollabPartnerz
IN
Below link might help you.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
CollabPartnerz
IN
Hi,
Below post is similar to your post.
https://collaborate.pega.com/discussion/calling-activity-html-section
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
TN
RU
Hello. This fragment can help you.
<%
HashStringMap params = new HashStringMap();
params.putString("pxObjClass", "Rule-Obj-Activity");
params.putString("pyClassName", "ActivityClass");
params.putString("pyActivityName", "ActivityName");
tools.putParamValue("ParamName","ParamValue");
tools.doActivity(params, tools.getPrimaryPage(), tools.getParameterPage());
%>