cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NGuill
Level: Powered On

Split CamelCase String

I am trying to automate the naming of a document as it is uploaded into SharePoint using the filename.  I've solved everthing I need except for the Title of the document.  The filename comes in the format of FA-38596-01_EmailNewWelcomeLetter_20190425  where the elements I need are split by the "_" character.  What I need help with is the second element (EmailNewWelcomeLetter). Is it possible using Flow to enter a space between each captialized word?  This element changes depending on the type of document.

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Split CamelCase String

Hi @NGuill 

 

Note: This is not the most efficient ways of doing this but it works. 

 

You can use the expression:
trim(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(variables('test'),'A',' A'),'B',' B'),'C',' C'),'D',' D'),'E',' E'),'F',' F'),'G',' G'),'H',' H'),'I',' I'),'J',' J'),'K',' K'),'L',' L'),'M',' M'),'N',' N'),'O',' O'),'P',' P'),'Q',' Q'),'R',' R'),'S',' S'),'T',' T'),'U',' U'),'V',' V'),'W',' W'),'X',' X'),'Y',' Y'),'Z',' Z'))
 
Please replace the highlighted part with the item that stores this value.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
 
 

View solution in original post

5 REPLIES 5
Dual Super User
Dual Super User

Re: Split CamelCase String

Hi @NGuill 

 

Note: This is not the most efficient ways of doing this but it works. 

 

You can use the expression:
trim(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(variables('test'),'A',' A'),'B',' B'),'C',' C'),'D',' D'),'E',' E'),'F',' F'),'G',' G'),'H',' H'),'I',' I'),'J',' J'),'K',' K'),'L',' L'),'M',' M'),'N',' N'),'O',' O'),'P',' P'),'Q',' Q'),'R',' R'),'S',' S'),'T',' T'),'U',' U'),'V',' V'),'W',' W'),'X',' X'),'Y',' Y'),'Z',' Z'))
 
Please replace the highlighted part with the item that stores this value.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
 
 

View solution in original post

Community Support Team
Community Support Team

Re: Split CamelCase String

 

Hi @NGuill ,

 

Could you provide a style that specifically describes the effect you want to render?

If you want to use "_" as a separator and get the second element, you can refer to the following expression:

146.PNG

If you want to replace "_" with a space, please refer to the following expression:

replace(variables('Title'),'_',' ')

147.PNG

 

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.
Highlighted
NGuill
Level: Powered On

Re: Split CamelCase String

Thanks @yashag2255, for your help.  I agree this is not an elegant way, but it gets the job done.  I'd prefer a regex type of solution though.

NGuill
Level: Powered On

Re: Split CamelCase String

Thanks @v-bacao-msft, but I had already stated that I had achieved splitting the text by "_".  I needed to insert a space before each capital letter in the second element.  Meaning I need the result to be "Email New Welcome Letter".

Dual Super User
Dual Super User

Re: Split CamelCase String

Hey @NGuill 

 

Yep. Regex is something that is a much needed feature. There have been some ideas created to include regex as a feature here

You can create a new one or UpVote the already created ones so that it reaches the product team. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,158)