You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven an example where I want to extract a property from an object that could or could not be in 2 different fields hence it's an OR behavior.
So here are 3 possible values for this object:
{"first_level": {"second_level": {"first_place": {"property": "aimed_value"}, "second_place": {"property": "another_aimed_value"}}}}
{"first_level": {"second_level": {"first_place": {"property": "aimed_value"}}}}
{"first_level": {"second_level": {"second_place": {"property": "another_aimed_value"}}}}
Found this expression: "first_level.second_level.[first_place.property,second_place.property]"
And these are the possible results:
["aimed_value", "another_aimed_value"]
["aimed_value", None]
[None, "another_aimed_value"]
I didn't want this and didn't find any examples for cleaning this data, but fooling around I realized that adding [] at the end of the expression removes the None values from the results. This would be great to have displayed on the examples section.
So this is the final expression: "first_level.second_level.[first_place.property,second_place.property][]"
And these are the final results:
["aimed_value", "another_aimed_value"]
["aimed_value"]
["another_aimed_value"]
The text was updated successfully, but these errors were encountered:
I haven an example where I want to extract a property from an object that could or could not be in 2 different fields hence it's an OR behavior.
So here are 3 possible values for this object:
{"first_level": {"second_level": {"first_place": {"property": "aimed_value"}, "second_place": {"property": "another_aimed_value"}}}}
{"first_level": {"second_level": {"first_place": {"property": "aimed_value"}}}}
{"first_level": {"second_level": {"second_place": {"property": "another_aimed_value"}}}}
Found this expression: "first_level.second_level.[first_place.property,second_place.property]"
And these are the possible results:
["aimed_value", "another_aimed_value"]
["aimed_value", None]
[None, "another_aimed_value"]
I didn't want this and didn't find any examples for cleaning this data, but fooling around I realized that adding [] at the end of the expression removes the None values from the results. This would be great to have displayed on the examples section.
So this is the final expression: "first_level.second_level.[first_place.property,second_place.property][]"
And these are the final results:
["aimed_value", "another_aimed_value"]
["aimed_value"]
["another_aimed_value"]
The text was updated successfully, but these errors were encountered: