从 HTTP 响应(字符串数据类型)中删除引用以传入 post API
我有一个返回数据(字符串格式)的 API,如下所示
84, 101, 115, 116
引号
“84, 101, 115, 116”
但是当我调用此功能时,我会通过 HTTP post 得到的响应自动化,并且带有 我可以在不使用引号“”的情况下获取它,因为我需要将输出发送到另一个 API,如果我
用“”发送它,该 API 就会失败。
原因是它需要将响应传递给另一个接受
像 [84, 101, 115, 116] 这样的
字节数组的 API,当前,流入它被发送为 ["84, 101, 115, 116"],这使得 API 失败
我尝试了替换功能,但它不适用于我的情况。
I have an API returning data(string format) like this
84, 101, 115, 116
But when I call this in power automate the response I get thru HTTP post is with quotation marks
"84, 101, 115, 116"
Is there any way I can get it without quotation mark " ", As I need the output to send in another API which fails if I send it
with "".
The reason being it needs to pass the response to another API that accepts byte array
like this [84, 101, 115, 116]
currently, inflow it is being sent as ["84, 101, 115, 116"] which fails the API
I tried replace function but it doesn't work for my case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您需要将文本分为数组。
首先初始化三个变量,如下所示...
...如您所见,我初始化了一个带有您值的字符串变量,它没有显示引号,但它被称为字符串请客,报价将在那里。
在接下来的步骤中,我初始化一个具有以下表达式的数组变量...
...然后是一个空白数组,该数组将存储所得的数字值。
在上述之后,循环循环,并将其添加到编号数组中,这将作为字符串将值转换为数字值。
上面的表达式是...
int(item(item())
,然后产生此结果,然后是该数组可以传递到您的下一个API调用。
这是JOSN定义,您可以将其加载到自己的租户中,以完整查看答案。
I think you need to split up your texts into an array.
Start with initialising three variables as shown below ...
... as you can see, I initialised a string variable with your values, it doesn't show the quotes but it's declared as a string so when it treats it, the quotes will be there.
In the next steps, I initialise an array variable that has the following expression ...
... and then a blank array that will store the resulting number values.
After the above, loop through each value that was found and add it to the number array, this will convert the value as a string to a numeric value.
The expression above is ...
int(item())
That then produces this result and it's that array that can then be passed through to your next API call.
This is the JOSN definition that you can load into your own tenant to see the answer in its entirety.