Use String Variable for JSON Path

all your solutions are ok. But how can I pass a string-variable as json’path. I tried i.e.:
str_jsonPath = " ““main””)(““temp”” "
val = jsonObj ( str_jsonPath ).ToString

// I need it cause I have to extract a lot of values (>30) with different paths in json; i.e. with a foreach path … ( the paths for all values are written in a dt)
// if it’s written direkt, it works:
jsonObj ( “main” )(“temp”).ToString,
jsonObj ( “weather” )(0)(“main”).ToString,…

we cannot bypass compilation

you can try using

strJSONPath = “$.main.temp”

Reading Value
Assign Activity:
strMyValue = myJObject.SelectToken(strJSONPath).Value(Of String)
intMyValue = myJObject.SelectToken(strJSONPath).Value(Of int32)


Writing Value
And combining SelectToken along with the Replace Function within an invoke Method


with Details:

it works!
congrats and thanks @ppr

hier a nice example if array in path (see json’example from the original topic’user):
str_jsonPath = “$.weather(0).main”
val = jsonObj.SelectToken( str_jsonPath ).ToString

Thanks @ppr

// where can I learn about using “$.x..” and SelectToken ?

and others findable by researches e.g. also online evaluators for learning experiments