friends here we're talking about James path Expressions to work with arrays and array values let me explain this with examples see suppose here we have sample. Json and if You observe here in this object this is an array so this array is associated with this key now suppose if you want to get this array or this value then we already know the syntax I mean jamesp expression so simply in place of James path expression we will use this key that's it but here for this key value nothing but this one this is an array that's
why you can also use syntaxes like this so whenever if your key value is an array then the best one to get all the array values is this one I mean key then square brackets inside that star that is the best syntax and here as of now our array is associated with a key inside this Json data but sometimes directly your Json file itself is an array like this so in that case how you can list all the array values so for that simply in place of jamesp expression you just take square brackets or square
brackets with star that's it now suppose let me take our sample. Json see suppose here let's say I want to get this value this is an array but this array is associated with this key but this is not a direct key in your Json so actually this key is inside this object this object is associated with this key then simply JP hyph F then devops tools dot this key so that you will get your required array but here the value for this configuration key is an array that's why the best practice is this syntax so
now in this array we have three values now let's say I want to get this value then how we can get it so to get this value first of all you have to get this entire array so for that already we have a syntax now in this array each and every value is associated with an index there are like the first value index is always zero and second value index is one third value index is three likewise suppose if you have four five six values then index values increases like this and these index values are
positive so instead of positive values there are negative index values also they are last value index is always minus1 then before that -2 then minus 3 like this now to get this Chef value from this array we can take either positive index value one or negative index value minus 2 let me show you that and here now instead of star just to provide your required value index let's say one or let's say minus 2 that's it suppose if you want to get the very first value simply you can take zero suppose let's say if you
want to get last value instead of counting index values like 0 1 2 always take minus one for last value that's it now suppose from this file if you want to get let's say last value then JP hyph F Json file see here we don't have any key for this array values your Json file directly is having an array so in that case simply take square brackets last value minus one or in terms of positive index values so first value zero index second value one index third value index is two that's it now suppose I
have a this Json data now I want to display this value then how can we get it so first of all practice see this value is there inside this array now to get this array we need to take this key but this key is there inside this object and this key is there inside this so recursively we need to apply I mean initially let me take company now dot departments dot engineering dot team lead now in this object we have two ke is name and skills but we need this JavaScript value that is there in
this array that array is associated with this key so simply dot skills but that is an array that's why basically best practice is like this but from this array we need last value so directly I can take minus one that's it I hope now you are in a position to apply James PA expressions for for arrays or array values okay thank you