cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DavidHug
Regular Visitor

deleting special characters without white space

Hi,

 

i'm trying to manipulate a string that is entered in a Text Input before submitting the content to the datasource.

I don't want to send special characters, but i need white spaces betweend the words and numbers.

 

after some research i have created this ugly formula here for the "submit"-Button:

Concat(Filter(Split(DataCardValue1.Text;"");IsMatch(Result;"^[a-zA-Z0-9\s]*$"));Result)

After this formula, the SubmitForm manages the data-saving-part - this works fine.

BUT ... white spaces were deleted out too - i need them!

 

in my research i learned, that the "\s" allows this white spaces...why are they deleted?

 

How can i save them?

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
earribasb
Regular Visitor

Your formula is working correctly as you can see in the next image.

 

Maybe is a problem in your DDBB and it deletes blank spaces?

Capture.JPG

View solution in original post

v-yutliu-msft
Community Support
Community Support

Hi @DavidHug ,

Do you only want to remove the special characters but the blank spaces are also removed by used the formula that you provided?
I've made a similar test but found that your formula works good for blank space.

Just as @earribasb  said.

Maybe you could try this formula:

Concat(Filter(Split(DataCardValue1.Text;"");IsMatch(Result;"^[a-zA-Z0-9\s]+"));Result)

If the problem still exists, then please tell me:

1)what is your data source?

2)what is this field data type?

3)how do you set that field?

4)the formula that you use to update?

 

The problem should be about updating or data source settings.

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
earribasb
Regular Visitor

Your formula is working correctly as you can see in the next image.

 

Maybe is a problem in your DDBB and it deletes blank spaces?

Capture.JPG

v-yutliu-msft
Community Support
Community Support

Hi @DavidHug ,

Do you only want to remove the special characters but the blank spaces are also removed by used the formula that you provided?
I've made a similar test but found that your formula works good for blank space.

Just as @earribasb  said.

Maybe you could try this formula:

Concat(Filter(Split(DataCardValue1.Text;"");IsMatch(Result;"^[a-zA-Z0-9\s]+"));Result)

If the problem still exists, then please tell me:

1)what is your data source?

2)what is this field data type?

3)how do you set that field?

4)the formula that you use to update?

 

The problem should be about updating or data source settings.

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yutliu-msft,

 

thank you for your help.

I've changed so many things to make this work, so i forgot to delete my earlier version of the formula in the update property of the form i'm using. That was the problem. 😔

 

Thank you and @earribasb for testing my formula.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,304)