Hi,
I am making an API call and with the result, I need to create a record in dataverse table for each row.
I am getting this common error:
Unable to process template language expressions in action 'Add_a_new_row' inputs at line '0' and column '0': 'The template language expression 'items('Apply_to_each')['name']?['text']' cannot be evaluated because property 'text' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.
The result of the previous step Parse JSON, I get:
{
"body": [
{
"id": "13c229e3-ab1d-4e3d-9f70-0ab45ac4f538",
"startDate": "2024-01-01",
"endDate": "2024-01-01",
"type": "National",
"name": [
{
"language": "ES",
"text": "Año Nuevo"
}
],
"nationwide": true
},
{
"id": "3107b89a-3546-48d1-be26-5a3446bf04d2",
"startDate": "2024-01-06",
"endDate": "2024-01-06",
"type": "Regional",
"name": [
{
"language": "ES",
"text": "EpifanÃa del Señor"
}
],
"nationwide": true
},
I did try with:
item()['name']?['text']
Same error.
Thanks for any help.
It works!!
Hi @EmilioRoqueta69,
As you mention it is within the body, so you will need to add the body property in your expression as well.
Please try
outputs('ApprovalAndWait')?['body']?['responses']?[0]['comments']
Hi, me again...
I have a response of an Approvals step in Power Automate
And I want to get the "comments" of the approver.
On the body outcome, I have:
So, I want to get: "comments": "IT IS OKAY"
I use:
outputs('ApprovalAndWait')?['responses']?[0]['comments']
It does not make an error, but I do not get the value of comments.
Thanks for any help!
Amazing! I knew that some combination will work.
Thank you !!
Hi mate!
Thanks for your help, for this column it works!!
But, I have same issue with other data in the same JSON
{
"id": "b0aaad54-ce7f-49f0-80fd-0c0493a3e634",
"startDate": "2024-11-01",
"endDate": "2024-11-01",
"type": "National",
"name": [
{
"language": "ES",
"text": "Todos los Santos"
}
],
"nationwide": true
},
{
"id": "abd232b4-37b6-47dd-ae5c-24735e9fd561",
"startDate": "2024-12-03",
"endDate": "2024-12-03",
"type": "Local",
"name": [
{
"language": "ES",
"text": "San Francisco Javier"
}
],
"nationwide": false,
"subdivisions": [
{
"code": "ES-NC",
"shortName": "NC"
}
]
}
Unable to process template language expressions in action 'Add_a_new_row' inputs at line '0' and column '0': 'The template language expression 'item()?['subdivisions'][0]['shortName']' cannot be evaluated because property '0' cannot be selected.
Please note that the object "subdivisions" is not always available in the records.
I did try with:
item()?['subdivisions'][0]['shortName']
item()['subdivisions'][0]['shortName']
And I get the same error message.
Hi @EmilioRoqueta69,
Name is an array. You can refer to the first and only item by using an index [0]
Try the below instead:
item()['name'][0]['text']
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492