Skip to Main Content

Intelligent Advisor

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Using javascript to set the value of a label to a string defined in attributes

Ross CurtisJun 27 2022

The current issue we're having with OPA is that we generate the html for an email to be sent out via a connector service.
Ideally we need to display this to the user in a label prior to submission with the html formatting rendering out. With substitution this appears to be blocked.
It's been suggested that this should be possible using js to bring the value through to the front end.
I think in principle I understand what needs doing based on some reading on the documentation and a look at the example projects, though I'm a C# developer and javascript is something I have very rarely touched so this is a learning curve.
What I'm after doing is essentially setting the label value to the attribute value so that the html renders.
So I've set up the opm.extension.data.json file to contain the name of the attribute value I want to use like

["emailbody"]

I've also created a property on the test label so as to be able to identify and work with it.
The script I'm trying to run is:

OraclePolicyAutomation.AddExtension({
  fullCustomInput: function(control, interview) {
    var extensionData = interview.getExtensionData();
		if (control.getProperty("type") === "body") {
			return {
				mount: function(el) {
					control.setValue(extensionData["emailbody"]);
				}
			}
		}
  }
});

However it doesn't seem to work and I'm not entirely sure how I would debug this. Any pointers?

This post has been answered by Richard Napier on Jun 27 2022
Jump to Answer

Comments

Processing

Post Details

Added on Jun 27 2022
4 comments
628 views