Anypoint studio(mulesoft)

时间:2018-05-04 12:00:23

标签: postman anypoint-studio

我是mulesoft的新手。我希望得到一个特定的值,或者我不使用数据库从这组细节中获取。

所以我使用文件连接器并发布并获取我的值 我使用mule请求程序将文件读​​取为将CSV文件转换为json的中间工作。现在它将所有值检索为JSON格式。我无法得到特定的身份..

有人可以帮忙解决这个问题吗?

2 个答案:

答案 0 :(得分:1)

假设您以json格式获取以下数据

{
    "entries": [{
        "Profile Status": "3",
        "Remedy Login ID": "jorge.hawkins",
        "Person ID": "KKPPPLL123212457788"
    }]
}

然后请尝试以下语法从json数据中获取特定ID

 #[json:entries[0]/'Person ID']

答案 1 :(得分:0)

您可以使用转换消息处理器将有效负载从json转换为java。这将帮助您遍历对象中的任何节点。在任何其他对象类型中遍历java对象要简单得多 如果您想在下面的有效负载中检索名称为“GHI”的客户状态,可以使用转换消息处理器将json转换为java,并使用“payload [2] .customer_detail.customer_status”下面的表达式来检索详细信息。例如。 JSON [{ "customer_name": "ABC", "customer_id": "1_ABC", "customer_detail": { "customer_age": 30, "customer_status": "Active" } }, { "customer_name": "DEF", "customer_id": "2_DEF", "customer_detail": { "customer_age": 31, "customer_status": "Inactive" } }, { "customer_name": "GHI", "customer_id": "3_GHI", "customer_detail": { "customer_age": 32, "customer_status": "Active" } }, ]

相关问题