How change text format

Hello!

I’m looking for an expression for capslock text formatting…
like…
Field name form = ALEXANDRE
then output = Alexandre

Hi, @alexandre2120 Welcome to the n8n community.

I have prepared a small workflow based on your question.

Just copy the below code and paste into the Workflow editor.

1 Like

Thank You!

1 Like

Hope it works. Enjoy. :watermelon:

Hi there,

At my end I have a list of items, not only one, but the given code in the Function node only takes changes the first item in my list of 100.

var final = $node["Set"].json["content"];
finaltext = final.charAt(0).toUpperCase()+ final.slice(1).toLowerCase();
items[0].json.text = finaltext;
return items;

Do you have any ideas how to change all entries?
Sorry I am not really fit with the function nodes…

I found out, its just working with a simple SET node:

Use that expression in your field:

{{ $json["text"].toLowerCase() }}
1 Like

what if there is no neither toUpperCase nor toLowerCase ???

@orth Welcome to the community! I hope your question is answered in How to apply toUpperCase()?

2 Likes