IoT事件将数字转换为字符串,以供SNS自定义载荷使用。

0

【以下的问题经过翻译处理】 在IoT事件中,我设置了一个事件来发送消息到SNS。我尝试使用自定义负载,在消息中包含值。下面标红的值是我想要使用的值,它是一个数字。当我在检测器GUI中运行我的事件分析时,它会出现以下警告:*消息:负载表达式“$input.CNC1Standard.vibration”无效。指定一个在运行时计算为字符串的表达式,因为负载类型是JSON格式。*

我已经查看了文档,但无法找到将数字转换为字符串的命令或示例。我尝试了负载类型为String和JSON,尝试了引号、转义字符等,但都没有成功。有什么方法可以执行转换吗?

1 Answer
0

【以下的回答经过翻译处理】 嗨,Ryan。我以前没有用过,但我认为你想要的是 convert() 函数:https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-expressions.html

profile picture
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions