Skip to content

JSON.GetValuesAtPath doesn't honor blank values in the array.  #26

@flybynight27

Description

@flybynight27

If I have an array where a certain key sometimes contains data and sometimes does not, the JSON.GetValuesAtPath does not leave those blank values in place, because it uses List. Since these are arrays, I would expect the order and placement to be honored.

Here is an alternative method that would leave blank lines in place:

While (

[
	¢Count = ValueCount ( JSONListKeys ( Array ; "" ) ) ;
	¢Iteration = 0 ;
	¢Values = ""
] ;

¢Iteration < ¢Count ;

[
	¢Values = ¢Values & Case ( not IsEmpty ( ¢Values ) ; "¶" ) & JSONGetElement ( Array ; "[" & ¢Iteration & "]" & Path ) ;
	¢Iteration = ¢Iteration + 1
] ;

¢Values

)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions