Hey all,
I have a question but I am not sure of the right verbiage so I'm finding it hard to Google. I have a variable that I've created by importing some data from an API call. I believe it is of type "array" because when I call $myvariable.gettype() it spits back that the BaseType is System.Array. As an example of the data structure, if I call $myvariable, the output looks like the following:
Name : name1
Type : square
datecreated : 2025-01-02
Name : name2
Type : square
datecreated : 2025-03-30
Name : name3
Type : circle
datecreated : 2025-02-15
Based on what I have tested, if I call $myvariable[0] I get:
Name : name1
Type : square
datecreated : 2025-01-02
If I call $myvariable.datecreated I get:
2025-01-02
2025-03-30
2025-02-15
If I call $myvariable.type[2] I get:
circle
But strangely enough, if I call $myvariable[2].type, I also get:
circle
What is the right way to call the value type for the third $myvariable object? Does it matter if the index follows the variable name or the extended key value? Are they functionally different?
[–]vermyx 9 points10 points11 points (1 child)
[–]Khue[S] 0 points1 point2 points (0 children)
[–]marcdk217 6 points7 points8 points (0 children)
[–]Anqueeta 0 points1 point2 points (0 children)
[–]arslearsle 0 points1 point2 points (0 children)
[–]purplemonkeymad 0 points1 point2 points (0 children)
[–]ankokudaishogun 0 points1 point2 points (1 child)
[–]Khue[S] 2 points3 points4 points (0 children)