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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ThreeTen22
Regular Visitor

Batch add rows via Logic App Connector?

Hey Guys.  I currently am trying to create a logic app that pushes ~50 items every 10 seconds into PowerBi via the logic app connector.  Due to the connectors limitations ill constantly hit the cap very quickly.  Looking at the Connector information there seems to be a "code only" optional parameter called "Payload" that I can use rather than the single row form that automatically displays.


However, in logic app's code designer I have tried setting Payload as an object variable, so its output would match your REST API call:

"Payload" : 
{
  "rows": 
            [ 
                {"ProductID":1,"Name":"Adjustable Race","Category":"Components","IsCompete":true,"ManufacturedOn":"07/30/2014"}, 
                {"ProductID":2,"Name":"LL Crankarm","Category":"Components","IsCompete":true,"ManufacturedOn":"07/30/2014"}, 
                {"ProductID":3,"Name":"HL Mountain Frame - Silver","Category":"Bikes","IsCompete":true,"ManufacturedOn":"07/30/2014"} 
            ] 
}


  As well as modify the variable to that of an array, so the connector's output would look like this:

"Payload": [ 
{"ProductID":1,"Name":"Adjustable Race","Category":"Components","IsCompete":true,"ManufacturedOn":"07/30/2014"}, 
{"ProductID":2,"Name":"LL Crankarm","Category":"Components","IsCompete":true,"ManufacturedOn":"07/30/2014"}, 
{"ProductID":3,"Name":"HL Mountain Frame - Silver","Category":"Bikes","IsCompete":true,"ManufacturedOn":"07/30/2014"} 
]

However both variations do not work.  As this functionality has been in Power BI's REST API for awhile, on top of the fact that the url string in the logic app connector itself goes to the same url as your REST API I can't imagine this cannot be done? 

4 REPLIES 4
v-micsh-msft
Microsoft Employee
Microsoft Employee

 

Is your DataSet a real time streaming DataSet?

The Dataset for the Power BI connector in Logic Apps, PowerApps and Microsoft Flow currently only supprts RealTime Streaming Dataset.

If not, then the Add rows to DataSet will not work.

 

Regards,

Michael

 

 

To clarify, are you saying that you can only submit an array of objects to the connector if the dataset is a "RealTime Streaming Dataset"? (it seems in this case it is a PushStreaming dataset with historical data turned off? / When looking at the dataset online it's API Access field is "Streaming")

 

Assuming that is the case I gave it a shot:

The Dataset:

Screen Shot 2018-04-12 at 6.51.22 PM.png

 

There is a single column, "Count", that accepts a Number.

 

Giving Payload a single object works fine:

Screen Shot 2018-04-12 at 6.53.18 PM.png

 

but give it an array and you get the error:

Screen Shot 2018-04-12 at 6.50.33 PM.png

This is the same error I got when I tried using PushStreaming, Push & Multi-Table Push datasets.  They all work however if I only provide a single object.

I ran into an old powebi blog article which showed the connector accepting an array of objects:

74e287bf-6a86-4b6e-982c-8b913757045a

I don't know if the devs reworked the connector somehow?

Thanks for the update.

The connector under Microsoft Flow seems to be updated.

12.PNG

 

The available DataSet listed are all streaming dataset, and the fields is generated automatically. So I am afraid the payload may not work at the current time.

You may consider add an apply to each loop in Logic Apps:

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-control-flow-loops

 

Regards,

Michael

 

considering each call in a while/foreach loop counts as a Connector call, the maximum rate of rows I can push per second is ~1.6 rows per second, (100 calls /  60s) , which is laughably unscalable..    I guess I will have to code this solution after all. 


(I would also suggest renaming the connector action to "add_row_to_dataset" as you cannot add more than one at a time).

 

Thanks for your time

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors