英文:
How to give values with array of objects as input to a step function input?
问题
我有一个阶梯函数输出,格式如下:
[{
"status" : "VALIDATION_FAILED",
"memberData":{
"metaData" : {
"fileId" : 101,
"FileName" : "abc.txt"
}
}
}]
现在我只想将 metaData 作为输入传递给步骤函数的下一步。
通常我们通过使用 inputPath: $.status 等方式访问数据。但我怀疑,由于存在 [ ],它给我一个错误:
' 无效路径 '$.status' :在路径 $ 中未找到属性 ['status']。
由于同样的原因,我无法访问任何变量。请问有人能指导我如何解决这个问题吗?
我找到了一些解决方案,但没有找到我需要的。
英文:
I have a step function output in the below format:
[{
"status" : "VALIDATION_FAILED",
"memberData":{
"metaData" : {
"fileId" : 101,
"FileName" : "abc.txt"
}
}
}]
Now I only want to give metaData as input to the next step in my step function.
Usually we access the data by using inputPath: $.status and so on. But I suspect, due to the presence of [ ], it's giving me an error of
' Invalid path '$.status' : Property ['status'] not found in path $.
I m unable to access any variable inside for the same reason. Can anyone please guide on how do I address this?
I came across some solutions but didn't get what I m looking for
答案1
得分: 1
A filter expression similar to the following can be used given the output above:
$[0].memberData.metaData
Ref: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-paths.html
英文:
A filter expression similar to the following can be used given the output above:
$[0].memberData.metaData
Ref: https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-paths.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论