Showing posts with label #modeldrivenapps. Show all posts
Showing posts with label #modeldrivenapps. Show all posts

July 12, 2024

Rich Text to Plain Text conversion inside Power Apps

Sometimes we need to get only the text from an HTML document, like the Rich Text format available for the text type inside Dataverse/Model-driven app.

If you need to perform this action client-side, a simple JavaScript function can be used:

function parseHTML(html) {
	let doc = new DOMParser().parseFromString(html, 'text/html');
	return doc.body.textContent || "";
}

function test_richtext_OnChange(executionContext) {
	var formContext = executionContext.getFormContext();
	let richTextValue = formContext.getAttribute("test_richtext").getValue();
	let cleanValue = parseHTML(richTextValue);
	formContext.getAttribute("test_plaintext").setValue(cleanValue);
}

It uses the DOMParser interface, here a screenshot on how the result looks like inside a model-driven app:



Hope it helps!

October 18, 2019

PCF Gallery - 5 months after

Today (18 October 2019) I added the 100th to PCF Gallery.

All the controls listed inside PCF Gallery can be downloaded, and the source code is available inside their GitHub repository or in the blog post linked inside the page. The majority of the controls is for Model-driven apps, some of them can be added also to Canvas apps and there are also a couple created specifically just for Canvas apps.

There is no doubt the PowerApps Component Framework is one of the most interesting capabilities landed recently inside the Power Platform world, at least for developers!

When I wrote the post announcing the launch of PCF Gallery, I optimistically wished that soon it would list dozen of controls. After few months, thanks to the contributions from more than 40 authors, PCF Gallery is a beautiful showcase of the possibilities offered by the PowerApps Component Framework.

A big thanks to the whole PCF Community!

May 20, 2019

PCF Gallery website launched!

If you are Dynamics 365 Developer (or I should say Power Platform Developer) you are probably aware of the trending topic of the last weeks: PCF.

What is PCF? PCF stands for PowerApps Component Framework, a new way to create custom controls for model-driven apps (more info at Microsoft Docs).

PowerApps Component Framework (also called in the past CCF Custom Control Framework) is an interesting concept to enhance the UX of our apps, it has been in private preview for a very long time and currently is in public preview.
Despite its preview state, many developers started to create controls and to avoid dispersion I decided to create a website to collect the amazing controls created by the Power Platform community, this website is PCF Gallery (https://pcf.gallery).

I created the site the other day so it's a bit empty right now, but I am sure soon it will list dozen of controls. If you created a control or you found a control and want it to be listed please contact me (by Twitter or email).
PCF Gallery has also an Ideas forum (thanks Nick Doelman for the suggestion) where people can submit their idea for new controls, hopefully developers can use them to build new controls for the community.
What are you waiting for? Click on the logo to get started!