Place html string into web viewer or label

I need some way of displaying a string of html into either web viewer or lebel, as it would look in html.

Here is a sample of what i am dealing with. The data is from wordpress api. All help is much appreciated!

image

I need the label below the title to not have all the html shabang. is there any way i can remove all of it. The data comes as a string from the api. I have seen methods to join html together in the web viewer, but this has not worked for me as it is just one string.

Any comments at all are really appreciated. Thanks

Instead of removing the HTML, why don’t you simply extract the stuff you want from the whole lot?

You know the tag used for what you need to retain?

The data you see in the screenshot above is what I am working with. In theory, i need the actual text from each paragraph. So i guess everything between each < p > and < /p >. but without things like font size, colours, font-types. This is the wordpress data. Thanks

So, what you are saying is that you want only the text “SAOLTA Healthcare Group has issued (…) up to 425 SIPTU members at LUH”; plus the text "A Spokesperson said: (…) ", is that it?

If so, have you noticed that this is everything that is NOT between a “<” and a “>”?

1 Like

Dumb question but would using the ‘get object from json’ block work?

Can you show what the text should look like as a result? Should it be plain text, as if we pasted it into a notepad or do we need to show it so that it looks in the browser with paragraphs, color, styles, etc.?

That is what it should look like. I would love to be able to keep the paragraphs. the greyed out writing at the end isn’t included in the part I am writing, i am yet to figure that bit out. Thank you

Yes is there a way i can remove everything between is between the < and >

Thanks!

This does not work for all posts, as some are different. is there any way i can place the original html into webviewer? thanks

Normally yes, but I do not see how you can take the text and save it in a file that you can then use as URL for a web-viewer in X. In classic, that would be no problem, but in X…

So you are saying there is no way to use the string that i get from there to paste in the web viewer?

are there any api’s or some sort of service online that allows me to upload html and return just the text? its just a pity because there are extra photos in the middle of articles :confused:

I am not saying there is no way, I am saying that I do not know of a way.

I essentially use Classic Thunkable, precisely because I need the features that have not yet been ported to X.

Removing everything that is between < and > would effectively strip everything but the text (though there may still be an issue with the specially encoded characters).
What do you mean by “some are different”?

Okay. Well I have considered making the worlds biggest if contains specifctext, replace with blank. or replace with speech marks etc. And then for photos in the post, have them at the end and somehow search each description for the start of the link, make a list with all the photos links between < and > if possible, and then have 5 photos at the end of the post, which gives me breathing space for 5 posts in one article, which is highly unlikely. The most i have seen is 3, including the cover photo. so that effectively gives me 6. but this is only an idea, and a lot of blocks. Would that work potentially?

I know it is very inefficient, that is just how i do things :stuck_out_tongue:

Only way to find out for sure: try it with a small test file.

I am guessing updating the web viewer to do something like this is not on the priority list.

I could do things as inefficiently as I wanted to even test my theory, only the lag is atrocious.

For testing ideas and concepts, I have a small dedicated application, which gets revamped with stuff removed and new stuff that needs testing added all the time. It typically has half a dozen buttons that are associated with different activities I want to evaluate.