I've run into a problem that's got me scratching my head and I can't seem to get past it - can someone help?
Trying to access a JSON property dynamically but it tells me that the property that clearly exists doesn't. ???????

Situation:
Trying to create a flow that is generic and uses an online spreadsheet to map fields. These fields are then used to help pull out values from a JSON object that has dynamic properties and values.
Sample JSON payload that I create and send to a handler flow:
{
"formId": "somelongstingoflettersreferringtoaform",
"responder": "responder@abc.com",
"questions": [
{
"id": "r78dbe3634ee567889a4c12be12345678",
"question_and_answer": {
"What do you need help with": "Something I can't figure out"
}
}
]
}Sample mapping values:
formId : somelongstingoflettersreferringtoaform
q_id : r78dbe3634ee567889a4c12be12345678
question : What do you need help with
field_type : Category
Steps in the flow
I use the filter array (f_arr_1) to retrieve the mapping values I need from the mapping spreadsheet:
#Filter array advanced mode:
@equals(item()?['field_type'], 'Category')
where Category refers to my mapping.
which returns:
# returned by f_arr_1
[
{
"@odata.etag": "",
"ItemInternalId": "0aaa00a0-aaa0-00a0-aaa0-00000de000aa",
"formId": "somelongstingoflettersreferringtoaform",
"question_hash": "r78dbe3634ee567889a4c12be12345678",
"question": "What do you need help with",
"field_type": "Category"
}
]Then I pass the questions array from the JSON payload accepted by the flow and use another filter array (f_arr_2) to select question_and_answer
#Filter array advanced mode:
@equals(item()?['id'], body('f_arr_1')[0]['q_id'])
# where q_id refers to my mapping and inserts r78dbe3634ee567889a4c12be12345678which returns
# returned by f_arr_2
[
{
"id": "r78dbe3634ee567889a4c12be12345678",
"question_and_answer":
{
"What do you need help with": "Something I can't figure out"
}
}
]I assign
variables('question') = body('f_arr_2')[0]['question_and_answer']so that variables('question') returns
{
"What do you need help with": "Something I can't figure out"
}I also assign
variables('selectON') = body('f_arr_1')[0]['question']so that variables('selectON') returns
What do you need help with
Problem:
The problem is when I try to dynamically access the property 'What do you need help with' from variables('question').
The expression I use is:
variables('question')[variables('selectON')]The error is:
Unable to process template language expressions in action 'Initialize_variable' inputs at line '1' and column '16134': 'The template language expression 'variables('question')[variables('selectON')]' cannot be evaluated because property 'What do you need help with' doesn't exist, available properties are 'What do you need help with'. Please see https://aka.ms/logicexpressions for usage details.'.
Notice that the error message says
'What do you need help with' doesn't exist, available properties are 'What do you need help with'
HOWEVER....
When I specify the name of the property explicitly,
variables('question')['What do you need help with']it resolves with no issue.
Only trouble is that I will have to hardcode the value. I do not want to do that....
Help please!!!