web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Action 'Add_a_new_row'...
Power Automate
Answered

Action 'Add_a_new_row' failed

(0) ShareShare
ReportReport
Posted on by 565

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.'.

 

EmilioRoqueta69_1-1715935620551.png

 

 

EmilioRoqueta69_0-1715935010775.png

 

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.

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,970 Most Valuable Professional on at

    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']
  • EmilioRoqueta69 Profile Picture
    565 on at

    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.

  • Expiscornovus Profile Picture
    33,970 Most Valuable Professional on at

    Hi @EmilioRoqueta69,

     

    Can you try the below?

    item()?['subdivisions']?[0]['shortName']

     

     

  • EmilioRoqueta69 Profile Picture
    565 on at

    Amazing! I knew that some combination will work.

    Thank you !!

  • EmilioRoqueta69 Profile Picture
    565 on at

    Hi, me again...

     

    I have a response of an Approvals step in Power Automate

     

    EmilioRoqueta69_1-1716288047969.png

     

     

    And I want to get the "comments" of the approver.

     

    On the body outcome, I have:

     

    {
      "responses": [
        {
          "responder": {
            "id""f60ceb5e-c091-4523-9f9b-4379d1fd7abd",
            "displayName""Emilio Roqueta",
            "tenantId""cb2e1a8c-fc01-4544-b000-3f23276c7031"
          },
          "requestDate""2024-05-21T10:24:58Z",
          "responseDate""2024-05-21T10:25:16Z",
          "approverResponse""Approve",
          "comments""IT IS OKAY"
        }
      ],
      "responseSummary""Approver: Emilio Roqueta\r\nResponse: Approve\r\nRequest Date: Tuesday, May 21, 2024 10:24:58 AM\r\nResponse Date: Tuesday, May 21, 2024 10:25:16 AM",
      "completionDate""2024-05-21T10:25:17Z",
      "outcome""Approve",
      "name""defd0275-8d3f-4444-b66f-ef3f34bda3a2",
      "title""New Holiday Request",
      "details""Type:         Holiday\nStart Date: 29/05/2024\nEnd Date:  29/05/2024\nWork Days: 1\nComments: ",
      "requestDate""2024-05-21T10:24:58Z",
      "expirationDate""9999-12-31T23:59:59Z",
      "priority""Medium"
    }

     

    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!

  • Expiscornovus Profile Picture
    33,970 Most Valuable Professional on at

    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']

  • EmilioRoqueta69 Profile Picture
    565 on at

    It works!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard