Do you want to remove quotes from a string in Power Automate? I will explain, step by step, how to remove quotes from string in Power Automate. In addition, I will also explain how to escape double quotes from strings in Power Automate.
Scenario:
Recently, while working on the Product development, I needed to remove quotes from a String using flow; for example, My input string looks like the below:
'United States'
Once I remove single quotes from the input string, the output string value should be displayed as below:
United States
To meet this need, we will create a flow to remove quotes from a string using the Power Automate flow
Remove Quotes from a String in Power Automate
Let us see how to remove quotes from a string using Power Automate.
Example-1:
In this example, I’ll show you how to escape a single quote from the user input string value using flow
Step-1:
Create an instant cloud flow with a manual trigger; add a text input for the input String as shown below:
Step-2:
Add a compose data operation and use the below expression to escape a single quote from the user input string value
replace(triggerBody()['text'],'''', '')
Step-3:
save and run the flow, Enter the input string value, and choose the run flow option. Here I have passed the input string value as ‘EnjoySharePoint’
- Once the flow runs successfully, we can see the expected output in the compose data operation.
- In the screenshot below, we notice it removes the single quote from the input string and displays the output value as EnjoySharePoint.
This is how to remove quotes from the string using Power Automate flow.
Example-2:
In this example, I’ll show you how to remove quotes from a string of the StringValuewithSingleQuotes field presented in the SharePoint list.
Here, I am going to use the below Technology SharePoint list, which consists of
Column Name | Column Type |
Technology | default title column |
StringValuewithSingleQuotes | Text column |
EscapeSingleQuotes | Text Column |
Step-1:
Create an Automate cloud flow with a When an item is created trigger, Expand the trigger action and provide the required parameters
- Site Address – Configure the SharePoint site address
- List Name – select the SharePoint list name (here, I have selected my Technology SharePoint list)
Step-2:
Add a compose data operation, and from the dynamic content, select the StringValuewithSingleQuotes value
triggerOutputs()?['body/StringValuewithSingleQuotes']
Step-3:
Add another compose data operation, and use the below expression to escape single quotes of the StringValuewithSingleQuotes field value for the newly created list item.
replace(outputs('Get_String_Value'),'''', ' ')
Step-4:
We will update the escaped single quote value to the EscapeSingleQuotes field presented in the SharePoint list
For that, Add a new step, choose the Update item action from action triggers, and provide the below parameters:
- Site Address – From the dropdown, select the SharePoint site address
- List Name – choose the SharePoint list; from the dropdown here, I have selected my Technology list
- ID – choose the ID from the dynamic content value
In the EscapeSingleQuotes field, pass the below expression:
outputs('remove_single_quotes')
Step-5:
Save and run the flow; I have created the below-highlighted list item with the single-quoted value.
Once the flow runs successfully, like below:
In the SharePoint list, the EscapeSingleQuotes field gets updated with the removed single quote string value using flow.
This is how to remove quotes from the string and update the SharePoint field using flow.
Escape Double Quotes in Power Automate
Let us discuss how to remove double quotes from a string in Power Automate.
Example-1:
In this example, I’ll show you how to escape double quotes from the user input string value using flow.
Step-1:
Create an instant cloud flow with a manual trigger, Add a text input for the input String as shown below:
Step-2:
Add a compose data operation and use the below expression to escape double quotes from the user input string value.
replace(string(triggerBody()['text']),'"', '')
Step-3:
save and run the flow, Enter the input string value, and choose the run flow option. Here, I have passed the input string value as “SPGuides”.
- Once the flow runs successfully, we can see the expected output in the compose data operation.
- In the screenshot below, we can notice it removes the double quotes from the input string and displays the output value as SPGuides.
This is how to remove double quotes from a string in Power Automate.
Example-2:
In this example, I’ll show you how to remove double quotes from a string of the StringValuewithDoubleQuotes field presented in the SharePoint list.
Here, I am going to use the below Technology SharePoint list, which consists of
Column Name | Column Type |
Technology | default title column |
StringValuewithDoubleQuotes | Text Column |
EscapeDoubleQuotes | Text column |
Step-1:
Create an Automate cloud flow with a When an item is created trigger, Expand the trigger action and provide the required parameters
- Site Address – Configure the SharePoint site address
- List Name – select the SharePoint list name (here, I have selected my Technology SharePoint list)
Step-2:
Add a compose data operation, and from the dynamic content, select the StringValuewithDoubleQuotes value
triggerOutputs()?['body/StringValuewithDoubleQuotes']
Step-3:
Add another compose data operation, and use the below expression to escape double quotes of the StringValuewithDoubleQuotes field value for the newly created list item.
replace(outputs('Get_String_Value'),'"', '')
ep-4:
We will update the escaped double quotes value to the EscapeDoubleQuotes field presented in the SharePoint list
For that, Add a new step, choose the Update item action from action triggers, and provide the below parameters:
- Site Address – From the dropdown, select the SharePoint site address
- List Name – choose the SharePoint list; from the dropdown here, I have selected my Technology list
- ID – choose the ID from the dynamic content value
In the EscapeDoubleQuotes field, pass the below expression:
outputs('remove_double_quotes')
Step-5:
Save and run the flow; I have created the below-highlighted list item with the double-quoted value
Once the flow runs successfully, like below:
In the SharePoint list, the EscapeDoubleQuotes field gets updated with the removed double-quoted string value using flow.
This is how to remove double quotes from a string in Power Automate.
Conclusion
I hope you understand how to remove quotes from a string using Power Automate.
Additionally, I have also explained how to remove double quotes from a string using flow
I have shown you different examples of removing single quotes from strings and escaping double quotes from strings by using the replace() function in Power Automate.
You may also like:
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.