Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Erika_S
Helper I
Helper I

Run query against a dataset and power automate to Add rows to Excel

Hi,

Im trying to populate some data into a Table in Excel which is online. There is another Flow that uses that table. The Script is for clearing previous values and then populating the table with only new values from Power bi set. The Add to Excel Field expression is : 

item()?['XXXX[xxxxxx]']

I keep getting this error:

InvalidTemplate. Unable to process template language expressions for action 'Apply_to_each' at line '0' and column '0': 'The number of foreach items limit exceeded for action 'Apply_to_each': maximum '5000' and actual '59135'.'.

Erika_S_0-1664956323143.png

 

Any help would be very appreciated!! 😁

 

5 REPLIES 5
PragsGiggle
New Member

Hi, Please elaborate with screenshot and codes.

Erika_S
Helper I
Helper I

Try adding Select before trying to add rows to excel.  Excel one has to be in a Table format aswell. 

Power automate Query Dataset to excel.JPG

Stake
Frequent Visitor

Its seems like you get a item limit as the Flow dont want to do the loop with more than 5000 elements. You could try to limit the query with the formula TOPN. TOPN(4999, SUMMARIZECOLUMNS('XXXXX'[XXXXX])). 

renearide
Frequent Visitor

I'm trying to run the same flow, but I don't see any dynamic Power Bi content for me to add in Excel. Below is a print of a test I'm doing. Can you help me?

Sem título.png

Hey, sorry, i somehow missed this. 

In Exspression try to put: items('Apply_to_each')?['Tabela Vendas[CLIENTES]'] etc. 

 

Let me know if that works.

 

all the best,

erika

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors