IoT Events convert number to string for SNS custom payload

0

In IoT Events, I have setup an Event to send a message to SNS. I am attempting to use a custom payload where I can include the value in the message. The value outlined in red below is what I am trying to use and it is a Number. When I run the Analysis on my Event in the Detector GUI, it gives this warning: *Message: The payload expression "$input.CNC1Standard.vibration" isn't valid. Specify an expression that would evaluate to a string at runtime because the payload type is JSON format. *

I have looked through the documentation and cannot find the command or an example for how to convert a Number into a String for this service. I have tried both String and JSON for the Payload type, played around with quotes, escape characters, and similar. Any ideas on how to perform the conversion?

Enter image description here

1개 답변
2
수락된 답변

Hi Ryan. I haven't used it before, but I think you want the convert() function: https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-expressions.html

profile pictureAWS
전문가
Greg_B
답변함 2년 전
  • Thanks Greg, that was it. I looked all over that documentation and didn't come across that command...I think I need more coffee ;)

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠