Skip to content
Advertisement

How can I assign a variable from a string inside a json dictionary?

This is my get output on each asset im getting data back from

enter image description here

I can access the dictionary values easily,

JavaScript

but how doo i access the value of the array, i want to be able to add up each critical vulnerability

this is the return, im trying to get critical, moderate, severe values from the vulnerabilities sub array

JavaScript

Advertisement

Answer

You’ve done a poor job of explaining it, but I’d bet that resources is a list of multiple dictionaries in your original data, and you want to do something with all of those values.

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement