Notifications
Announcements
No record found.
We have a business requirement that we need to move data from a multi-line rich text field to a simply multi-line text field. I have tried using Power Automate to move the data but the HTML comes through into the simple multi-line text field. I am thinking we need to use javascript to do this. Here is what i currently have (definitely a beginner at javascript). This code snippet errors out with "ReferenceError: Web resource method does not exist: copyField". Any recommendations or help would be greatly appreciated!
function CopyField(executionContext) { var formContext = executionContext.getFormContext(); formContext.getAttribute("new_meetingagenda").setValue("new_timeentrydetails") }
Hi,
Javascript is not adapted to your needs because it runs on the client side.
Power Automate is a very good choice. You will need to remove the HTML in the rich text field. I invite you to read the following post to do it: powerusers.microsoft.com/.../731195
For information, the javascript error you got comes from the case sensitivity of javascript. copyField vs CopyField.
Hi AZWildcat1290,
Maybe you need get old field firstly:
formContext.getAttribute(arg).getValue()
https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/attributes/getvalue
The code should like this:
function CopyField(executionContext) { var formContext = executionContext.getFormContext(); var details = formContext.getAttribute("new_timeentrydetails").getValue(); formContext.getAttribute("new_meetingagenda").setValue(details); }
And you can refer to the following blog to appply js code on the form:
https://carldesouza.com/get-and-set-field-values-using-formcontext-and-javascript-with-dynamics-365/
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 45 Super User 2025 Season 2
Daniyal Khaleel 27 Most Valuable Professional
Soundari 15