Escaping special Characters when use 'Get Text' keyword

I have been using the ‘Get Text’ keyword for simple assertation. But, sometimes text start with special characters like &,$… If I created manually I can use "" but in this case, the text comes from a web element. Then I set this result as a global variable.

I got this error message.

Invalid dictionary variable item '${'selected_brand'}'. Items must use 'name=value' syntax or be dictionary variables themselves.

How can handle it?

Thanks in advance!

You have an “error” in the variable name. Don’t use quotes.
Name should be ${selected_brand}.

You can use python string functions, to cleanup variables.

For example:

Thank you so much @HelioGuilherme66