Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unable to pass values dynamically to mashup code

SA-67620

Summary



A Pega Web Mashup code is generated from the case type.

Values are passed using JavaScript variables in the Mashup DIV data attributes to send additional arguments dynamically,


data-pega-action-param-parameters ='{"Arg1":arg1Value,"Arg2":arg2Value}'

However, the application login page displays instead of Pega Gadget.


Error Messages


 
Not Applicable


Steps to Reproduce

  1. Generate the Mashup code from the case type.
  2. Add the line of text, 'data-pega-action-param-parameters ...', to the Mashup code with custom arguments.
  3. Run the Mashup HTML code.


ROOT  CAUSE

A software use or operation error.

The issue occurred because the data-pega-action-param-parameters where custom parameters are provided is an HTML5 data attribute which does not support templating. Variable expansion is not supported out-of-the-box.


Resolution



Perform the following local-change:

Use the JavaScript code or any other Web Template System to insert dynamic elements to the data-pega-action-param-parameters Pega Web Mashup attribute.

Use the following JavaScript code can be used for this purpose:


<script src ='http://desktop:7731/prweb?pyActivity=pzIncludeMashupScripts'></script>
<body>
<!-- ---------------------- Begin Pega content ---------------------- -->

<div id="PegaGadget#1"
data-pega-gadgetname ='PegaGadget
data-pega-action ='createNewWork
data-pega-action-param-classname ='PegaCA-Work-AddressChange
data-pega-action-param-flowname ='pyStartCase
data-pega-action-param-model ='' 
data-pega-isdeferloaded ='false' 
data-pega-applicationname ='PegaCSSample
data-pega-threadname ='STANDARD' 
data-pega-systemid ='pega'
data-pega-resizetype ='stretch' 
data-pega-url ='http://desktop:7731/prweb' 
data-pega-redirectguests ='true' ></div>

<!-- ---------------------- End Pega content ---------------------- -->

</body>
<script>
    var action_param = "{UserIdentifier:'CACSR',Password:'cnVsZXM=',ctn:'123',channellId:'456'}";
    var gadget = document.getElementById("PegaGadget#1")
    gadget.setAttribute("data-pega-action-param-parameters", action_param);
</script>


Add the JavaScript code, that assigns the data-pega-action-param-parameters value, after the corresponding DIV element.

Published August 19, 2019 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us