How do I pull values out of an array of objects

If it is all in one message, which I think it is, then I think that can be rewritten as
If msg.payload.extended[21].textValue is "Grid lost" then set status Red
Otherwise, if msg.payload.extended[3].rawValue is <= 50 set status Amber
Otherwise set status Green.

That can be done using Switch nodes as in this flow.

[{"id":"12b9fa3ceda3a249","type":"switch","z":"84405ff5.25fa6","name":"","property":"payload.extended[21].textValue","propertyType":"msg","rules":[{"t":"eq","v":"Grid lost","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":190,"y":3160,"wires":[["556fbc5abe4caaf9"],["80c124c13585e360"]]},{"id":"80c124c13585e360","type":"switch","z":"84405ff5.25fa6","name":"","property":"payload.extended[3].rawValue","propertyType":"msg","rules":[{"t":"lte","v":"50","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":350,"y":3200,"wires":[["9028bd9635ca9428"],["fcf4ef05d789e732"]]},{"id":"556fbc5abe4caaf9","type":"change","z":"84405ff5.25fa6","name":"change to red","rules":[{"t":"set","p":"payload","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":3140,"wires":[[]]},{"id":"9028bd9635ca9428","type":"change","z":"84405ff5.25fa6","name":"change to orange","rules":[{"t":"set","p":"payload","pt":"msg","to":"orange","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":3180,"wires":[[]]},{"id":"fcf4ef05d789e732","type":"change","z":"84405ff5.25fa6","name":"change to green","rules":[{"t":"set","p":"payload","pt":"msg","to":"green","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":3220,"wires":[[]]}]