msr79526
(SR Official)
January 9, 2021, 5:32pm
#21
{
"names": [
{
"name1": "Peter",
"age": 30
},
{
"name": "John",
"age": 27
},
{
"name": "Luke",
"age": 34
}
]
}
{
"names": [
{
"name2": "Peter",
"age": 30
},
{
"name": "John",
"age": 27
},
{
"name": "Luke",
"age": 34
}
]
}
I want to parse name 1 & name 2 value
Here we have two different JSON object. You have to separate them, or make them in a list.
2 Likes
Separate them so it looks like these two JSON texts:
{
"names": [
{
"name1": "Peter",
"age": 30
},
{
"name": "John",
"age": 27
},
{
"name": "Luke",
"age": 34
}
]
}
and this
{
"names": [
{
"name2": "Peter",
"age": 30
},
{
"name": "John",
"age": 27
},
{
"name": "Luke",
"age": 34
}
]
}
Then,
do this with both JSON, change the name1 to name2 when working with the second object.
1 Like
msr79526
(SR Official)
April 9, 2021, 1:45pm
#25
how can we use the if-else block to create a dictionary
I have no idea of what you’re talking about May you elaborate with some examples.
2 Likes
I just wanted to know, is it necessary to have keys without space? I added space within a key and now it’s giving me an error - “Invalid List of Pairs”.
dora_paz
(Dora)
April 15, 2021, 5:12am
#28
It is not neccerary, the error comes from something else.
1 Like
@dora_paz is right. If you want, feel free to send sample blocks of code and let me and others to have a look.
2 Likes
I made a dictionary in which there’s a key, and the value is a list with one item (I’ll be adding more later), when use the block get Value For Key In Dictionary
it gives me the error.
Taifun
Split this topic
December 1, 2021, 11:01pm
#32
A post was split to a new topic: I want to make dictionary
Srrazmi
(Web And App Developer)
May 20, 2022, 5:04am
#33
Hi Every one How To Get All Facts If I Have This Type Of JSON
[
{
"Name": "Losi"
},
{
"Name": "Peter"
},
{
"Name": "John"
}
]
Set label text to
Get value for the key path (make a list (1. Walk at all level)(2.Name))
Dictionary (get global list name)
1 Like
dora_paz
(Dora)
May 20, 2022, 5:10am
#35
It’s an array, so try this way , note that if this is a part of a bigger json this might not work. You have to study the structure of your json
2 Likes
TrickyLabX
(Tricky Lab X)
July 11, 2022, 9:06am
#36
what will we do if we want name and age both
Use the same block and replace the text name to age into another variable
1 Like
How to i get value form this
I want (order id) value please help me
List by walking key path (make a list[ results, Order id]
dictionary get web1 JSON Text Decode json text (above json code)
(make a list[ results, Order id]
What do you mean results