Dynamic-Dimmer Passing in msg.payload

Hi folks! How do you pick up msg.payload from a previous node and use it in the data of a call-service node? I’m working with the “Dynamic-Dimmer” node. I can’t seem to figure out how to use the values it outputs as the brightness values in the call-service node.

[{"id":"28112ec9.8d1712","type":"inject","z":"62148d2.ecc1274","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":90,"y":2300,"wires":[["6d0abd35.a12274"]]},{"id":"6d0abd35.a12274","type":"dynamic-dimmer","z":"62148d2.ecc1274","name":"","eventInterval":200,"steps":10,"minValue":0,"maxValue":100,"x":290,"y":2300,"wires":[["9b9d05fc.7873f8"]]},{"id":"9b9d05fc.7873f8","type":"api-call-service","z":"62148d2.ecc1274","name":"light.living_room_lamp","server":"fb338851.a73818","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room_lamp","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":540,"y":2300,"wires":[[]]},{"id":"fb338851.a73818","type":"server","name":"New Home Assistant","version":1,"legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

I assume the dynamic dimmer is a percentage? if you are certain that number is stored in msg.payload and it’s a %, then this will do it:

[{"id":"9b9d05fc.7873f8","type":"api-call-service","z":"b7ef5764.977e88","name":"light.living_room_lamp","server":"fb338851.a73818","version":3,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room_lamp","data":"{\"brightness_pct\": \"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":440,"y":1980,"wires":[[]]},{"id":"fb338851.a73818","type":"server","name":"New Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]