cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Remove all characacters but numbers from a variable.

Hi, thanks for rading this.

This is basicly what I'm trying to do

email arrives, subject is stored into a variable, now I just need to remove all characters in the string BUT numbers. Is there an easy way to do this? I've looked for a long time but everything I found is either old or confusing. Any help would be appreciated.

Thanks!.

1 ACCEPTED SOLUTION

Accepted Solutions

@amdamd 

Sounds good.

Here is a modification from the blog to help you:

for the array I used:

createArray('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z')

 

I had to add a expression on the Compose Email Subject

toLower(<Pass in your email subject dynamic content here>)

for your expression type:

toLower() than inside your () click on the dynamic content for your email subject 

This step ensures all the alphabet are found.





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

12 REPLIES 12
Super User III
Super User III

Hello @amdamd 

 

You can follow this blog here:

https://www.alanps1.io/power-platform/flow/flow-stripping-unwanted-characters-or-special-characters-...

instead of putting the special characters in the array, put the alphabet





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




I tried doing that, but for some reason the gui is different or I'm missing features, I can't paste this:

createArray('.','@','ß','²','³','µ','`','´','°','^','=','(',')','&','$','§', '~','#','%','*',':','<','>','?','/','|',' ')

in the value

it says it's not a valid array format.

arraybroken.JPGarraybroken2.JPG

Managed to enable adding expressions since it's not default and noone tells you about this, but the replace expression doesnt' work either.

replacedoesntwork.JPG

@amdamd

I have a tip for you. I see that you're using the advanced features for expressions. These are great but, I would stick with the default settings until the experimental feature is more generalized.

 

The blog has a error.. Use:

replace(variables('Sanitise'), item(), '')

 

The error was double quotes. We only want 2 single quotes

 

 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Ok, that worked, but, arent I supposed to, you know, get the correct output without the extra characters like in the blog picture?

I just get the same thing as if I hadn't done anything at all or I'm just missing the output completely, but I checked all vars and they're all the same basicly this:

doesntwork.JPG
EDIT: Looks like it removed the characters it felt like, but I literally followed the blog indicatinos at all times.

@amdamd 

Could you share more screenshots of your flow





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




New Member

1)
1.JPG
2)
2.JPG

3)3.JPG
4)4.JPG
5)
5.JPG


Thanks! really.

@amdamd 

 

Hmm.. That is strange,

 

I will build the flow right now to see if I run into the same issue.

 

Please check one thing for me while I build though.

 

What is your Apply to each loops concurrency set to?

You can check this by clicking the 3 dots on the action, and than settings.

There is an option for Concurrency.

Is it enabled? if so disable it





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Hey, thanks for your help, yeah it's disabled.


Wait, I'm actually not expecting these characters in the email subject, I just need to remove the alphabet and some "-" signs, so it may still work I'm about to try it and do as you said replace special characters with teh alphabet, hope it works.

@amdamd 

Sounds good.

Here is a modification from the blog to help you:

for the array I used:

createArray('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z')

 

I had to add a expression on the Compose Email Subject

toLower(<Pass in your email subject dynamic content here>)

for your expression type:

toLower() than inside your () click on the dynamic content for your email subject 

This step ensures all the alphabet are found.





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (7,061)