You can't in Power Apps, but you can in Power Automate. I face this often when a custom connector returns a JSON dictionary rather than a JSON array.
SampleArray:
[
{"Key": "ABCD", "Value": 1},
{"Key": "EFGH", "Value": 2}
]
SampleDictionary:
{
"ABCD":
{"Value": 1},
"EFGH":
{"Value": 2}
}
To find a value in the array, I might:
LookUp(SampleArray, Key="ABCD").Value
If the key I want is a constant, then I could do this in the dictionary:
SampleDictionary.ABCD.Value
But let's say the key I want is a string variable called MyKey. I might want to say:
SampleDictionary.MyKey.Value // That surely won't work
LookUp(SampleDictionary, Key=MyKey).Value // That won't work either, as the dictionary is not a table
In desperation, I end up writing a short Power Automate flow, passing the dictionary (or whatever) into the flow as a JSON string.
After whatever massaging is needed to create Compose actions with my dictionary and my key, I can then use an expression like this:
Outputs('SampleDictionary')?[Outputs('MyKey')]
and get value(s) from that as...
Outputs('SampleDictionary')?[Outputs('MyKey')]?['Value']
If you haven't already, it may require a new learning curve to get familiar with Power Automate (whose language bears no resemblance to Power Fx). But as far as I know it's the only way to do it.