Power Automate issue - invalid filename issue
Hi,
I am attempting to use a replace function in power automate to remove invalid characters from the name field so the SharePoint file will save. Below is the formula I created. I originally only had the function replacing the comma and the period, but the output for Bob Smith, Jr. outputs as "Bob Smith Jr \\r". I added to the function to replace the backslash but it isn't replacing it.
replace(replace(replace(outputs('Get_a_constituent')?['body/name'], ',', ''), '.', ''), '\\', '')

I'm wondering if the backslash isn't actually part of the name, but I'm not sure where it is coming from.
If anyone can point me in the right direction, I would appreciate it.
Comments
-
Hey @Hallie Guiseppe, the \\r is a special character that's returned for a carriage return (new line). Instead of doing Replace('\\') try Replace with decodeUriComponent('%0A')
2 -
@Hallie Guiseppe, actually, after testing, this is the best way:
decodeUriComponent(
replace(
encodeUriComponent(variables('test')),
'%0A',
' '
)
)
The variables('test') is just the output that has line breaks in it.
0 -
@Matt Thacker Thank you so much for pointing me in the right direction! I ended up basically with what you suggested. (I didn't see your second post until I logged back in to follow up with what I built) I had to break it into two actions. One to encode the name and another to replace. I couldn't get it to work when I had them in the same action.
Also, I found that MS recommends using “uricomponent()” rather than “encodeUriComponent()” although I'm not sure why. The two resources I found most useful are the Reference Guide and the HTML URL Encoding Reference.
Enode function= uriComponent(outputs('Get_a_constituent')?['body/name'])
Replace invalid Characters= replace(replace(replace(outputs('encode_Constituent_Name'),'%20',' '),'%2C',''),'%0D','')

compose actions to convert name into save format 1
Categories
- All Categories
- 6 Blackbaud Community Help
- 211 bbcon®
- 1.4K Blackbaud Altru®
- 402 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 656 Blackbaud Grantmaking™
- 577 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 941 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.7K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 120 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 240 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 796 Community News
- 3K Jobs Board
- 54 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
