cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Hustle-Flow
Level: Powered On

Abbreviate/Concatenante

Hi Flowers! 

 

I have a need to take one or more words and abbreviate/concatenate them into a three letter representation of those words like so:

 

Corel Draw = CRD

My Application = MAP

Historian Data Collector = HDC

 

Is there a way to do this in Flow via an expression?

 

Thank you!

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Abbreviate/Concatenante

Hi @Hustle-Flow ,

 

Is there a rule that can be followed to splicing this word?

CRD is to get two letters from the first word, MAP is to get two letters from the second word, there seems to be no rules to generate the desired abbreviation.

 

What I can do with Expression is to rely on the following rules to form abbreviations.

  • If it is two words, take the first two letters from the first word, and then take the initials from the remaining words to form the abbreviation.
  • If it is three words, take the initials to form the abbreviation.

Image reference:

  • Use split() function to split the target into spaces to produce an array. Initializes a variable of type string to store the letters of the abbreviated word.

8.PNG

  • Traverse the array and determine if the number of words is 2 or 3. If it is 3, just take the first letter of each word.

9.PNG

 

  • If it is 2, then it is judged whether the current array element is the first element. If yes, take the first two letters; if not, take the first letter.

10.PNG

 

  • Use Append to string variable action to integrate letters into abbreviations.

 

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hustle-Flow
Level: Powered On

Re: Abbreviate/Concatenante

An overall constraint I have:

 

1) The resulting data has to be limited to three letters

 

What will your expressions do if one word is encountered?

What will your expressions do if four or more works are encountered?

 

Thanks again, this is looking great!


HF

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,126)