How to filter html tags while searching for an alphabet

How to filter html tags while searching for an alphabet

  

Hi All,

I am saving the data in the database with the html tags. While i am trying to search for a alphabet from that data. Its searching along with the html tags.But i want the data inside that tags has to show .Help me out with a solution


Regards,

Koushik.

hi, 

may be you can use regex (regular expression), , something like this in Oracle:

in outsystem you can find regex:

regards,

indra

Solution

Indra Budiantho wrote:

hi, 

may be you can use regex (regular expression), , something like this in Oracle:

in outsystem you can find regex:

regards,

indra


Thanks for your reply . can you elaborate how to use on sql query



Solution

hi Khousik,

I use the regex in the expression when display the record:


You cannot put the user function in the aggregate. If you stick to use in database, write a procedure in the database (Oracle, SQL Server, etc) and then use SQL widget to call that function.


regards,

indra

Indra Budiantho wrote:

hi Khousik,

I use the regex in the expression when display the record:


You cannot put the user function in the aggregate. If you stick to use in database, write a procedure in the database (Oracle, SQL Server, etc) and then use SQL widget to call that function.


regards,

indra

Can you send me the expression image one more time


Hi Koushik, Indra.

You can check the Text and HTML Processing forge component, which allows you to easily parse HTML and extract information from it.

leonardo.fernandes wrote:

Hi Koushik, Indra.

You can check the Text and HTML Processing forge component, which allows you to easily parse HTML and extract information from it.


Hi fernandes,

I have used regex_escape pattern server action again its showing the same issue.Can you help me out with which server action i have to take.

Regards,

Koushik


If you use the component I spoke before, you can use the action HtmlRemoveUnsafeTags to remove the tags from a string.

Now, if you're searching on the database, and it's matching entries inside the tags, then you need to have a new text attribute on which you store the text without the tags. In other words, when you create or update the entity and store an HTML text in it, you also need to store side-by-side another version without the tags. Then you use this other version for searching.

the output of the html remove tag action is object data type. so i am want to convert it into the text data type.But there is no built in function in outsystems.So do you have any solution to overcome this issue.


You can use the HtmlDocumentBodyToString function to retrieve the contents of the <body> tag:

HtmlDocumentBodyToString(HtmlRemoveUnsafeTags.CleanHtmlDocument)

But While I am Using the text and html processing . i am getting the error " [OUTSYSTEMS].DBO.[OSUSR_U9A_TAGWHITELISTPRESET1] with key 0 was not found" in my applicaion.


The HtmlRemoveUnsafeTags action receives an optional parameter with a preset, and you can choose from a few of them.


Just make sure to add the TagWhitelistPreset entity as a dependency. Here is a demo of the different presets in action: https://leonardofernandes.outsystemscloud.com/textprocessinghelp/HtmlSanitizing.aspx

Thanks Indra Budiantho and leonardo.fernandes your both suggestions are working fine.Thanks for your support.