I'm getting a bunch of string values from a stored proc from SQL Server, I'm just trying to add double quotes to a couple of strings from the result set.
let's say I'm getting a string like so; TEST so to this string I'm trying to add double quotes like this "TEST".
If I add the double quotes in the source, so the string would come in as "TEST", flow just add more quotes to it like this """TEST"""
Thanks for your help!
How are you trying to use this string that "flow just add more quotes" and did you deliberately put three sets of quotes on each side of that second example, or was it supposed to be 2? That is, did you mean """TEST""" or ""TEST""?
This is an example what I'm trying to do;
I'm trying to just add double quotes to strings in the Compose with replace, when I run the flow nothing gets added to the string in the Compose 2 strings.
Yeah, that is not how Replace works. It takes a literal character search string, finds that string everywhere in the input and replaces it with a literal character replacement string.
If you're trying to wrap the entire string in one set of quotes, you just want to have a new Compose that is something along the lies of
'"' + Compose1 + '"'
(or you can use string append operator, but the addition character should work fine for string building)
If you're trying to wrap each member of the comma separated list in quotes, you'll need to be slightly more elaborate. Something along these lines this ought to do the trick:
'"'+ Replace(Compose1, ', ', '", "') + '"'
thanks for replying to my post. somehow I'm trying to build that string taking your example, but somehow the
expression is complaining that's an invalid expression.
Yes. I think maybe you should consider some basic string manipulation instruction or courses. You should get an understanding of what a string is and how you work with it before you continue.
Thanks but I know what a "String" is, I'm trying to get some help on how to manipulate it in power automate that seems to be finicky with strings. Manipulating strings with SQL is easy or C# as well but this is my first time that I'm trying to manipulate string with this tool, that's why I'm looking for some help.
Sorry to have offended. I think I confused your reply with a different email notification.
OK, so yes, you will get 'invalid expression' message from pasting my suggestion because I just wrote it off the top of my head. I am not in your flow, therefore I do not have the object model of your flow.
You need to write something along those lines in your flow, so:
Obviously, you need to put your parameter name in there instead of Test, Test
So when I write the
Yeah, sometimes PowerAutomate prefers that you actually use the concat method instead of just the addition operator. Here, I did a quick proof, so this syntax should work fine for you (you will probably have to replace the param name, but it should otherwise work)
concat('"', replace(outputs('Compose'), ', ', '", "'), '"')
thanks for your replies to my post. still have an issue with this, I will illustrate below;
So like I said as the beginning of this post, I'm bringing data from a stored procedure from SQL Server like this; both fields are strings in SQL Server.
So from these values, I want to build a CSV table; without adding anything to the items in the Expression, they comes out like this; Body without any quotes
Now I just want to add double quotes to both strings, concat( '"', item()?['TEST'], '"') and concat( '"', item()?['TEST1'], '"'), they come out like this;
They come out with triple double quotes at each side of the strings?? would you know how to get rid of the extra 2 double quotes at each side of the strings?
Keep up to date with current events and community announcements in the Power Automate community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!