Numeric value from binary combination of three inputs

can you help me?, I downloaded this code to be able to have a numeric value composed of the binary string .
but I always have the same l,ettere... I'm new, can you help me?
My intent is to have the sum of the binary combination of the three switches. Thank you

[
    {
        "id": "combineInputs",
        "type": "function",
        "z": "c9fb757ceef6051f",
        "name": "Combina Input",
        "func": "let inputs = [msg.payload.input1, msg.payload.input2, msg.payload.input3];\nlet binaryString = inputs.join('');\nlet numericValue = parseInt(binaryString, 2);\nreturn { payload: numericValue };",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 490,
        "y": 190,
        "wires": [
            [
                "outputNode"
            ]
        ]
    }
]

Please give an example of the three input values. including datatype, and the result you want to calculate.

Also a screen capture (or, better, an export) of your flow.
It is important to make it clear if the three inputs are part of a single message or three separate messages.

I have inserted code that I am testing and that does not work in the test, I have three digital inputs (0/1) and I need to have an output word that gives me the value...example. input 1 ..bit 0, input 2 ..bit 1, input 2. bit 2 (of the word) etc.etc ...if bit 0 =1, bit1=0, bit2=1...word value =5., if only one state changes, the value changes

I can't import your code, so at the moment I cannot help you.

a) There is a button </> which lets you post code in the forum so that we can import it.
b) I am not really clear if your 3 digital inputs travel down 3 different wires. If they do, the function node will only ever see one at any time. It will not store msg.payload.input1 etc until you need it. See https://cookbook.nodered.org/basic/join-streams

From the very limited info you are giving I am guessing the info is in separate messages.

You would need to join the messages so the function node can have all the information in one message.

Here is an example floe doing that

[{"id":"68943d9bc8d51b20","type":"inject","z":"d1395164b4eec73e","name":"input1  0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"input1","payload":"0","payloadType":"num","x":150,"y":4380,"wires":[["410edfa1c8688df6"]]},{"id":"410edfa1c8688df6","type":"join","z":"d1395164b4eec73e","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","useparts":false,"accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":350,"y":4500,"wires":[["da98fc37bcbe5f4c"]]},{"id":"adf81e5b4f464977","type":"inject","z":"d1395164b4eec73e","name":"input1  1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"input1","payload":"1","payloadType":"num","x":150,"y":4420,"wires":[["410edfa1c8688df6"]]},{"id":"d284ba4231cd60b4","type":"inject","z":"d1395164b4eec73e","name":"input2  0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"input2","payload":"0","payloadType":"num","x":150,"y":4480,"wires":[["410edfa1c8688df6"]]},{"id":"0b2f6bde40a010e3","type":"inject","z":"d1395164b4eec73e","name":"input2 1","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"input2","payload":"1","payloadType":"num","x":150,"y":4520,"wires":[["410edfa1c8688df6"]]},{"id":"e0786000e0cc25fe","type":"inject","z":"d1395164b4eec73e","name":"input3  0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"input3","payload":"0","payloadType":"num","x":150,"y":4580,"wires":[["410edfa1c8688df6"]]},{"id":"aae87b344e2b0123","type":"inject","z":"d1395164b4eec73e","name":"input3  0","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"input3","payload":"1","payloadType":"num","x":150,"y":4620,"wires":[["410edfa1c8688df6"]]},{"id":"da98fc37bcbe5f4c","type":"function","z":"d1395164b4eec73e","name":"function 1","func":"let inputs = [msg.payload.input3, msg.payload.input2, msg.payload.input1];\nlet binaryString = inputs.join('');\nlet numericValue = parseInt(binaryString, 2);\nmsg.payload = numericValue;\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":4500,"wires":[["430e70962d4e3370"]]},{"id":"430e70962d4e3370","type":"debug","z":"d1395164b4eec73e","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":4500,"wires":[]}]