I have an example JSON array (Week_JSON_Compose) below that's being passed to my flow. I can parse everything fine aside from AllowanceDetails. I believe this is due to the dynamic length causing me issues.
I can access the nth element well enough:
outputs('Week_JSON_Compose')[2]['AllowanceDetails'][0]['Text'].
However, when i try and dynamically join like so:
join(outputs('Week_JSON_Compose')[2]['AllowanceDetails']['Text'], ', ')
I get the error:
"Unable to process template language expressions in action 'Email_HTML_Compose' inputs at line '0' and column '0': 'The template language expression 'join(outputs('Week_JSON_Compose')[2]['AllowanceDetails']['Text'], ', ')' cannot be evaluated because property 'Text' cannot be selected. Array elements can only be selected using an integer index"
Just wondering if it would be possible to get some help with this please?
[
{
"AllowanceDetails":[],
"Date":"2024-09-09",
"Index":1,
"Location":"Dummy Location 1",
"Note":"Dummy note 1: Something happened on this day.",
"ShiftType":"Dummy Shift Type 1"
},
{
"AllowanceDetails":[],
"Date":"2024-09-10",
"Index":2,
"Location":"Dummy Location 2",
"Note":"Dummy note 2: Another event occurred here.",
"ShiftType":"Dummy Shift Type 2"
},
{
"AllowanceDetails":[
{"Text":"Overnight Tax Free"},
{"Text":"Breakfast"},
{"Text":"Evening Meal"}
],
"Date":"2024-09-11",
"Index":3,
"Location":"Dummy Location 3",
"Note":"Dummy note 3: A training session took place.",
"ShiftType":"Dummy Shift Type 3"
},
{
"AllowanceDetails":[
{"Text":"Overnight Tax Free"},
{"Text":"Evening Meal"}
],
"Date":"2024-09-12",
"Index":4,
"Location":"Dummy Location 4",
"Note":"Dummy note 4: Extra security measures were introduced.",
"ShiftType":"Dummy Shift Type 4"
},
{
"AllowanceDetails":[
{"Text":"Overnight Tax Free"},
{"Text":"Breakfast"},
{"Text":"Evening Meal"}
],
"Date":"2024-09-13",
"Index":5,
"Location":"Dummy Location 5",
"Note":"Dummy note 5: Power outage for an hour.",
"ShiftType":"Dummy Shift Type 5"
},
{
"AllowanceDetails":[
{"Text":"Overnight Tax Free"},
{"Text":"Breakfast"},
{"Text":"Evening Meal"}
],
"Date":"2024-09-14",
"Index":6,
"Location":"Dummy Location 6",
"Note":"Dummy note 6: Smooth shift with no issues.",
"ShiftType":"Dummy Shift Type 6"
},
{
"AllowanceDetails":[
{"Text":"Overnight Tax Free"},
{"Text":"Breakfast"},
{"Text":"Evening Meal"}
],
"Date":"2024-09-15",
"Index":7,
"Location":"Dummy Location 7",
"Note":"Dummy note 7: Testing of new equipment was done.",
"ShiftType":"Dummy Shift Type 7"
}
]
Update: I've solved it.
@{outputs('Week_JSON_Compose')}
@{join(body('Allowance_Details_Select'), ', ')}
@{join(body('Allowance_Details_Select'), ', ')}