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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Failed to add row to E...
Power Automate
Answered

Failed to add row to Excel Sheet

(0) ShareShare
ReportReport
Posted on by 22

For context, trying to build a flow that extracts information from documents to automate entry into our database. I created a custom AI builder model that extracts the information and now I want to add the data into two separate tables into an excel sheet. 

I get this error when I ask PA to add information to two tables at the same time. I wasn't getting this error when using one table. 

"The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerBody()['file']['contentBytes']' is of type 'String'. The result must be a valid array."

I am having the AI pull data from the document into the table and want to include data from a table from the document. Maybe there is a better way to do this? This whole process is new to me and I could be overlooking something simple. I just want to pull all the information from the specific boxes in the document into excel so I can easily import it. This would save hours of work per week. Thanks! 

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @Mr_Ian The error is indicating you are using a string value in the Apply to Each action. The Apply to Each action requires an array of items to loop through. You don't have that. 

     

    Add a Compose action after your AI action and store the dynamic content that you have in your Apply to Each action. Run a test and upload a screenshot of the outputs of those Compose actions.

  • Mr_Ian Profile Picture
    22 on at

    Tried it a few ways and still doesnt seem to be working. Anything else that would help to diagnose? 

  • Verified answer
    creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at

    @Mr_Ian To help you better understand what is returned from the AI Builder actions I would recommend you create a Compose action for EACH of the dynamic content that you'd like to add into your excel sheet. 

     

    Remove the Add row to table action all together from your flow first. It's not needed now. You need to verify the outputs of the dynamic content first to see if the values you are trying to add to Excel match what your Excel table requires. 

     

    Create a separate Compose action for EACH of the dynamic content you inserted into this one Compose action. Tip: RENAME your Compose actions so it's clear which value is stored in which compose action when you review. 

    creativeopinion_0-1695405222049.png

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

  • Mr_Ian Profile Picture
    22 on at

    Ahhhhh Ok I see. Thank you for the tip

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard