首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在逻辑应用程序中获取Azure函数输出的问题

在逻辑应用程序中获取Azure函数输出的问题
EN

Stack Overflow用户
提问于 2019-10-14 11:01:04
回答 1查看 1.3K关注 0票数 0

在我的逻辑应用程序中试图获得Azure函数的输出时,我遇到了一些问题。

当我查看蔚蓝函数输出时,在正文中,"m_StringValue"返回我想要的内容。当我在后面放一个条件来检查azure函数体是否返回了我想要的东西时,它会返回false。

Azure逻辑应用程序流:

Azure逻辑应用程序输出:

应用程序代码如下

代码语言:javascript
复制
{
    "$connections": {
        "value": {
            "azureblob_1": {
                "connectionId": "x",
                "connectionName": "azureblob-5",
                "id": "x"
            },
            "office365": {
                "connectionId": "x",
                "connectionName": "office365-5",
                "id": "x"
            }
        }
    },
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Is_from_a_known_sender": {
                "actions": {
                    "Should_be_forwarded_to_a": {
                        "actions": {},
                        "else": {
                            "actions": {
                                "Should_be_forwarded_to_b": {
                                    "actions": {
                                        "For_each": {
                                            "actions": {
                                                "Condition_2": {
                                                    "actions": {},
                                                    "expression": {
                                                        "and": [
                                                            {
                                                                "contains": [
                                                                    "@body('Parse_JSON')?['properties']?['m_StringValue']",
                                                                    "abc"
                                                                ]
                                                            }
                                                        ]
                                                    },
                                                    "runAfter": {
                                                        "Parse_JSON": [
                                                            "Succeeded"
                                                        ]
                                                    },
                                                    "type": "If"
                                                },
                                                "Create_blob_for_each_attachment": {
                                                    "inputs": {
                                                        "body": "@base64ToBinary(items('For_each')?['ContentBytes'])",
                                                        "host": {
                                                            "connection": {
                                                                "name": "@parameters('$connections')['azureblob_1']['connectionId']"
                                                            }
                                                        },
                                                        "method": "post",
                                                        "path": "/datasets/default/files",
                                                        "queries": {
                                                            "folderPath": "/attachments",
                                                            "name": "@items('For_each')?['Name']",
                                                            "queryParametersSingleEncoded": true
                                                        }
                                                    },
                                                    "runAfter": {},
                                                    "runtimeConfiguration": {
                                                        "contentTransfer": {
                                                            "transferMode": "Chunked"
                                                        }
                                                    },
                                                    "type": "ApiConnection"
                                                },
                                                "ExtractTextFromPDF": {
                                                    "inputs": {
                                                        "body": "@body('Get_blob_content')",
                                                        "function": {
                                                            "id": "x"
                                                        }
                                                    },
                                                    "runAfter": {
                                                        "Get_blob_content": [
                                                            "Succeeded"
                                                        ]
                                                    },
                                                    "type": "Function"
                                                },
                                                "Get_blob_content": {
                                                    "inputs": {
                                                        "host": {
                                                            "connection": {
                                                                "name": "@parameters('$connections')['azureblob_1']['connectionId']"
                                                            }
                                                        },
                                                        "method": "get",
                                                        "path": "/datasets/default/files/@{encodeURIComponent(encodeURIComponent(body('Create_blob_for_each_attachment')?['Id']))}/content",
                                                        "queries": {
                                                            "inferContentType": true
                                                        }
                                                    },
                                                    "runAfter": {
                                                        "Create_blob_for_each_attachment": [
                                                            "Succeeded"
                                                        ]
                                                    },
                                                    "type": "ApiConnection"
                                                },
                                                "Parse_JSON": {
                                                    "inputs": {
                                                        "content": "@body('ExtractTextFromPDF')",
                                                        "schema": {
                                                            "properties": {
                                                                "m_MaxCapacity": {
                                                                    "type": "integer"
                                                                },
                                                                "m_StringValue": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    },
                                                    "runAfter": {
                                                        "ExtractTextFromPDF": [
                                                            "Succeeded"
                                                        ]
                                                    },
                                                    "type": "ParseJson"
                                                }
                                            },
                                            "foreach": "@triggerBody()?['Attachments']",
                                            "runAfter": {},
                                            "type": "Foreach"
                                        }
                                    },
                                    "expression": {
                                        "and": [
                                            {
                                                "contains": [
                                                    "@triggerBody()?['From']",
                                                    "xandreu"
                                                ]
                                            }
                                        ]
                                    },
                                    "runAfter": {},
                                    "type": "If"
                                }
                            }
                        },
                        "expression": {
                            "and": [
                                {
                                    "contains": [
                                        "@triggerBody()?['From']",
                                        "test"
                                    ]
                                }
                            ]
                        },
                        "runAfter": {},
                        "type": "If"
                    }
                },
                "expression": {
                    "and": [
                        {
                            "or": [
                                {
                                    "contains": [
                                        "@triggerBody()?['From']",
                                        "xandreu"
                                    ]
                                }
                            ]
                        },
                        {
                            "equals": [
                                "@triggerBody()?['HasAttachment']",
                                true
                            ]
                        }
                    ]
                },
                "runAfter": {},
                "type": "If"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "When_a_new_email_arrives": {
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['office365']['connectionId']"
                        }
                    },
                    "method": "get",
                    "path": "/Mail/OnNewEmail",
                    "queries": {
                        "fetchOnlyWithAttachment": true,
                        "folderPath": "Inbox",
                        "importance": "Any",
                        "includeAttachments": true
                    }
                },
                "recurrence": {
                    "frequency": "Minute",
                    "interval": 3
                },
                "splitOn": "@triggerBody()?['value']",
                "type": "ApiConnection"
            }
        }
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-14 14:04:34

你的身体状况包含"abc“是错误的。它认为它是把身体当作一个物体来阅读。

尝试添加"Parse Json“语句,然后更改条件,只检查string value字段。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58375408

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档