153
Views
7
Comments
Solved
Remove Symbols in Local Variable from the given Text

I what to Remove Symbols and spaces in local variable which is a data type of Text and it has a mix length of 10. 

I have used a Restrict char but no use, i have even added a "Regex_Replace" extension in onchange for input widget but working is not efficient.

My requirements: User can only Enter a text or number in input widget, if user enters any space or Symbol like "()@#$%^?>< etc.., they should be removed.

kindly suggest any solution if have any idea on my issue.
Thank you.

UserImage.jpg
Nani
Solution

Hi 

kailian Hekhuis 

I have used Disable Characters Through RegEx - Reactive Forge component with
(Regex = "[a-zA-Z0-9]+$") it's working exactly what i intend, i was trying with input mask component but its not working as I intend to.

Thank you,

Kilian Hekhuis.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi nani,

Did you already checked in forge for something that do what you need? Please, take a look here:

https://www.outsystems.com/forge/component-overview/7071/remove-special-characters-and-accents

https://www.outsystems.com/forge/component-overview/4945/just-letters


Hope this can help you. :)


Best regards,

Ricardo

UserImage.jpg
Nani

Hi 

I have already used Extensions and you posted Components are working same which i was used.
my Issue is resloved i have used Javascript

Thank you, Ricardo Pereira

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Nani,

Have you checked the Input Mask Forge asset (for Reactive)? It may do what you want. Otherwise, if you want to clean the input after the fact, you could create an ad-hoc loop (using a counter) and Substr to check whether a character is valid, and add it to the output.

UserImage.jpg
Nani
Solution

Hi 

kailian Hekhuis 

I have used Disable Characters Through RegEx - Reactive Forge component with
(Regex = "[a-zA-Z0-9]+$") it's working exactly what i intend, i was trying with input mask component but its not working as I intend to.

Thank you,

Kilian Hekhuis.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Ah, great, I didn't know that Forge component, but that seems like a useful one :).

2023-01-26 16-03-24
Ana Agostinho

Hello Nani, 


My suggestion would be: 
1- To remove the spaces I would use the Trim function provided by OS: (https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/built_in_functions/text/)


For the validation of characters, my approach would pass by creating a function and Subt, as @Kilian Hekhuis suggested :) 
Analyze what is better for you, do it on change or after losing focus. 

Best regards, 

Ana

UserImage.jpg
Nani

Hi, 

Ana Agostinho

I have Already Tried outsystems Trim and Replace functions but they don't Match my Requirements.

I have Resloved my issue where i have used Javascript to Remove Special Characters and Space.

Thank you For the Response.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.