0

I have free text column in Dataverse table where alphanumeric values are entered e.g. abc123, 123abc, 1abc23. (numbers can be anywhere in string - no fix pattern) I want to extract ONLY numbers and discard letters using Power Automate.

How to do it? I google a lot but no luck. I found solution here but its not efficient solution at all. Please guide.

1
  • Hi, did you try below solution? Is it working for you? Commented Feb 22, 2023 at 7:24

1 Answer 1

0

Try this flow (example):

enter image description here

It works by creating a do until loop that looks at each character of the string that contains the number. In this case a compose step called “string”. If the character is equal to 0 to 9 or a period then it is appended to the variable called newString, otherwise it is discarded.

Formula used in in the Append to string variable action:

concat
(
if(equals(substring(outputs('string'), variables('index'), 1), '0'), '0', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '1'), '1', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '2'), '2', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '3'), '3', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '4'), '4', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '5'), '5', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '6'), '6', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '7'), '7', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '8'), '8', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '9'), '9', ''),
if(equals(substring(outputs('string'), variables('index'), 1), '.'), '.', '')
)

Source: Power Automate – How to extract numbers from a string

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.