Having issue in decoding JSON

I am receiving data from MQTT publisher and that data is in JSON format. I decoded data using JSON node and it is decoded but after that i need to access the values and insert that values in mysql database.

var msg1 = msg1.payload.TagData[0].Values.M6_Current_A;
return msg1;

i have JSON in this format

{"FormatId":"TagValues","ApiVersion":1,"CollectionId":5,"TagData":[{"Time":"2019-10-01T11:36:07.918+05:00","Values":{"M6_Current_A":9.1834094859526887e-41,"M6_Current_B":0,"M6_Current_C":0,"M6_Current_N":0,"M6_Current_Avg":0,"M6_Voltage_A_B":396,"M6_Voltage_B_C":398.80389404296875,"M6_Voltage_C_A":394.85699462890625,"M6_Voltage_L_L_Avg":397.1259765625,"M6_Voltage_A_N":228.4644775390625,"M6_Voltage_B_N":230.25553894042969,"M6_Voltage_C_N":229.00503540039062,"M6_Voltage_L_N_Avg":229.99998474121094,"M6_Active_Power_A":7.3468677186085834e-41,"M6_Active_Power_B":0,"M6_Active_Power_C":0,"M6_Active_Power_Total":0,"M6_Frequency":50.499996185302734,"M6_Wapda_KWH":0}}]}"

Your kind help is needed

Moved to general as it is a question.

msg1.x does not exist.

To get the value use:

m = msg.payload.TagData[0].Values.M6_Current_A
return {payload:m}

Hi @Maria

The title says you have a problem decoding JSON, but your question is about inserting into a database and no mention of problems with json.

Could you clarify what you have done and what exactly you want to do?

Have you looked at the mysql nodes available on flows.nodered.org? What have you tried so far?