从有效载荷Dateweave中提取文件

问题描述

Am试图仅从输入数据中提取两个字段并将其设置为变量inn mule 4

输入:

{
   "Id": "a9PV00000","OwnerId": "00570000001c9fmAAA","IsDeleted": "false","Name": "Account","CreatedDate": "2020-08-05T16:08:49.000Z","CreatedById": "00570000001c9fmAAA","LastModifiedDate": "2020-08-26T13:24:33.000Z","LastModifiedById": "00570000001c9fmAAA","SystemModstamp": "2020-09-04T13:09:57.000Z","LastActivityDate": [],"LastViewedDate": "2020-09-09T08:10:29.000Z","LastReferencedDate": "2020-09-09T08:10:29.000Z","Object_API_Name__c": "Account","Active__c": "true","Upload_files_attachments__c": "true","Delete_files_attachments__c": "false","Folder_Name_": "Google Drive Notes and Attachments","Parent_Folder_": "1oV_wWX-19ut"
}

在转换消息中使用以下表达式

%dw 2.0
output application/json
---
payload map (Sample,indexOfSamples) ->{
    "name": Sample.Name,"parentId": Sample.Parent_Folder
    
}

但是它现在可以工作了。我该如何实现?

解决方法

如何直接访问必填字段?

%dw 2.0
output application/json
---
{
     "name": payload.Name,"parentId": payload.Parent_Folder_
    
}

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...