首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Anypoint studio (mulesoft)

Anypoint studio (mulesoft)
EN

Stack Overflow用户
提问于 2018-05-04 20:00:23
回答 2查看 86关注 0票数 0

我是mulesoft的新手。我想要获得一个特定值,或者从一组详细信息中获得一个值,而不使用数据库。

所以我使用file连接器和来post和获取我的值。

我使用mule requestor读取文件作为中间工作,将CSV文件转换为json。现在,它以JSON格式检索所有的值。我无法获得特定的id..

有谁能帮我解决这个问题吗?

EN

回答 2

Stack Overflow用户

发布于 2018-05-04 20:48:32

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

代码语言:javascript
复制
{
    "entries": [{
        "Profile Status": "3",
        "Remedy Login ID": "jorge.hawkins",
        "Person ID": "KKPPPLL123212457788"
    }]
}

然后,请尝试使用以下语法从您的json数据中获取特定ID

代码语言:javascript
复制
 #[json:entries[0]/'Person ID']
票数 1
EN

Stack Overflow用户

发布于 2018-05-08 15:03:00

您可以使用transform message processor将有效负载从json转换为java。这将帮助您遍历到对象中的任何节点。在java对象中的遍历比在任何其他对象类型中简单得多。

例如: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" } }, ]

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

https://stackoverflow.com/questions/50174440

复制
相关文章

相似问题

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