Wanting to add html characters to Database Update Action Step

I am probably doing this wrongly.

I want to create notes per DB record, so these notes are stored in a single field. Date and time is added to the beginning of each submission. This is a mock-up of what I want to end up with…

image

This is the MySQL DB Update…

And the update binding

{{$_POST.prev_notes + NOW.formatDate('dd/MM/yyyy') + ' at ' + (NOW.formatDate('h:mma')) + ' : ' + $_POST.notes}}

This is what I want to achieve, I have done this manually in phpMyAdmin…

image

I thought I could do something like and add some HTML directly

{{$_POST.prev_notes + '<br><i>' + NOW.formatDate('dd/MM/yyyy') + ' at ' + (NOW.formatDate('h:mma')) + ' :</i> ' + $_POST.notes}}

but it won’t work.

Can someone throw some light?

I know I could probably use Summernote but I wanted to avoid that and try something more basic.

So which part is not working exactly?
“It doesn’t work” is never a good explanation an it’s never helpful for us, which means you won’t get a solution fast …

I apologise for failing to describe the issue properly.

When I add the HTML tag '<br>' for the first time in the Update Server Action, saving it and going to the page in Chrome, adding a note and submitting it, I get the desired result as you can see in this screenshot from phpMyAdmin, includes the '<br>'

image

And it displays correctly in the browser

image

I go back into the Update Server Action and the HTML tags have disappeared

I know I didn’t describe the disappearing bit earlier, mainly because I didn’t realise that is what had happened.

Can you see the tags in the server action JSON after saving?
It could be that when re-opening, it’s just not showing the HTML tags, but its there in code?

Good thinking Sid, you are right, fresh screenshots from this morning

Teodor, is this something you can look at?
Cheers

So it’s only the UI where you are not seeing your html tags? Are they properly inserted in the database and are they then properly working on the page?

Yes Teodor

image

image

And as a side note, I am seeing strange entries in the Action Steps Global $_POST, these seem to be being added automatically when I have been playing with different options.

From what I understand, since Wappler is Chromium based, HTML stuff sometimes gets interpreted literally in the UI.

For eg: Save some HTML in set value action step, and you can see it being ‘rendered’ in the properties panel.
Although that does not hamper the functioning.

A workaround for sanity, just in case this cannot be fixed / until its fixed:
Create variable (set value) for <br/><i>, and use that in your db query UI like {{htmlBR}}.
You will still not see actual value in the set value, but you will know by name what it contains. :sweat_smile:

Note on the side note: Have experienced this quite commonly since the beginning I think. Maybe this requires a separate bug post.

I suppose my original post was looking for this sort of suggestion. I did have thoughts along these lines but wasn’t sure so thanks.

I decided to set 3 variables:
'htmlBR' for '<br />'
'html_i' for '<i>'
'html_i2' for '</i>'

In the screenshot below, setting the 3rd variable, the value is correct but you can see that none of the html tags show in the steps

image

When you click away and then select the variable again, the html tag has disappeared

image

but if I click on the pencil you can see that the html tag shows in the content box

image

This also another bug. The value in value field does not get converted to “expression” then-and-there. It does only after you come-back to that step.

With variables, it would be a bit more maintainable now, I hope.