Alright guys, I feel like a knucklehead. Node-red has been running beautifully for awhile and I haven't needed to change anything. Now I need to extrapolate some data from an object and only pass those values. I thought I did it before with a Function Node, but I can't seem to get anything to work. This is the incoming data.
{"data":{"common":{"productId":{"wwwItemId":"276","upca":"630","productId":"7A9H","offerId":"EE212DDAE","ean13":"060312"},"name":"Litvst","department":"","thumbnailImageUrl":"","productImageUrl":"https://","customerRating":{"rating":4.1,"count":152},"productUrl":"https://","variantSwatches":[],"offerType":"ONLINE_AND_STORE","twoDayShippingEligible":false,"storePickupAvailable":false,"storePickupAvailableToday":false,"nextDayShippingEligible":false},"inStore":{"price":{"priceInCents":1000,"currencyUnit":"USD"},"location":{"aisles":["N9"],"detailedAisles":[{"zoneName":"N","aisleName":9,"sectionName":2}]},"storeId":XXXX},"online":{"price":{"priceInCents":2499,"currencyUnit":"USD","showInCart":false},"inventory":{"status":"In Stock","available":true},"specialOfferBadge":"rollback","specialOfferText":"Rollback"},"relatedItemsUrls":{"inStore":"https://","online":"https"}}
The values from the msg.payload is msg.payload.data.common.name, msg.payload.data.inStore.price.priceInCents, payload.data.inStore.storeId, etc.
I have a change node and function node which will extract msg.payload.data.common.name, but it becomes it's own separate message. I'd basically like to remove all the useless info from the payload. I just can't remember how.
[{"id":"822d599.c1c9ca8","type":"change","z":"c3e84d4e.4ead68","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.data.common.name","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":2160,"wires":[["1cb49f4.fe872e1","d847038d.95dde"]]},{"id":"1cb49f4.fe872e1","type":"function","z":"c3e84d4e.4ead68","name":"","func":"msg.payload = `Name:${msg.payload}`;\nreturn msg;","outputs":1,"noerr":0,"x":1130,"y":2160,"wires":[["3a4f0c57.7d8c74","a26ef6e1.a115d8"]]}]