web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send key with opening ...
Power Automate
Answered

Send key with opening bracket (

(0) ShareShare
ReportReport
Posted on by 49

Hi, 

I'm using PowerAutomate Desktop and need to send key opening and closing brackets () from an Excel file. 

Closing bracket is working for me: 

1- I used replace text for ), and it's working: 

Closing_bracket.PNG

 

2- But opening bracket is not working for me. 

 

Opening_Bracket_9.PNG

 

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @SoSo0 

    Why do you use regex and escape characters if you are replacing all occurrences / not searching for a specific pattern?

    Did you try to replace just () without using the regex?

  • SoSo0 Profile Picture
    49 on at

    I did and all combinations failed. 

    SoSo0_0-1679402774455.png

    SoSo0_1-1679402805130.png

     

    I even tried placing the () between curly brackets but that didn't work 

    SoSo0_2-1679403173627.png

     

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Can you tell what exactly fails? What error do you get?

  • SoSo0 Profile Picture
    49 on at

    It either fails with "No Active Key"
    Or the text is filled incorrectly
    e.g 

    If I'm not using regex, the text will be filled incorrectly 

    SoSo0_2-1679403488324.png

     

    SoSo0_1-1679403456872.png

     

    If I'm using regex it fails with this error:

    SoSo0_3-1679403562211.png

     

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    sorry for being a pain @SoSo0 

    Can you paste me:

    1. Original text you want to analyze

    2. The text you want to get after it is converted (write manually)

    3. What next do you want to do with that text? (I assume from what you wrote you want to send it with send keys)

  • Verified answer
    SoSo0 Profile Picture
    49 on at

    The original text is from Excel sheet and it is saved into a variable. 
    The variable will be used by send key. 

    The original text: 

    Robotic process automation (RPA) is a software technology that makes it easy to build, deploy, and manage software robots that emulate humans actions interacting with digital systems and software.

    Follow the steps below to build your first workflow: 

    1- 

    2- 

    The ouptut needs to be the same without any change, and need to be submitted to a website using send key. 
    I need to keep the newline and the () in the original text. 
    So I'm not looking to modify, but I can't use brackets with sendkey. 
    Thanks for taking the time to look at this.

  • Verified answer
    momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    So there we go. Let me explain:

     

    Input text: Robotic process automation (RPA) is a software

    Step 1:

    We simply replace "(" with "{Shift}(9)"

    Our text is now: "Robotic process automation {Shift}(9)RPA) is a software"

     

    Step 2:

    Here, we can't simply replace ")" as we want to preserve our "{Shift}(9)" from the previous step.

    We want to replace all ")" that do not have "{Shift}(9" in front of them.
    To do that, we need to use regex with a negative look-behind: 

     

    (?<!{Shift}(9)\)

     

     

    Here is a working code that you can copy-paste to your PAD designer:

     

     

    SET Text TO $'''Robotic process automation (RPA) is a software technology that makes it easy to build, deploy, and manage software robots that emulate humans actions interacting with digital systems and software.
    
    Follow the steps below to build your first workflow: 
    
    1- 
    2-'''
    Text.Replace Text: Text TextToFind: $'''(''' IsRegEx: False IgnoreCase: False ReplaceWith: $'''{Shift}(9)''' ActivateEscapeSequences: False Result=> Text
    Text.Replace Text: Text TextToFind: $'''(?<!{Shift}\(9)\)''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''{Shift}(0)''' ActivateEscapeSequences: False Result=> Text

     

     

     

     

  • SoSo0 Profile Picture
    49 on at

    I'm new to powerautomate. I'm not sure where I should paste this? 
    Which action in PA Desktop I should use? 

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Open Power Automate Desktop

    Create a new blank flow

    Copy the code from the post

    Right-click on the empty flow page (where you add actions) and choose paste.

     

  • SoSo0 Profile Picture
    49 on at

    Thank you
    That worked perfectly!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard