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 Apps / Create 1 or more colle...
Power Apps
Unanswered

Create 1 or more collections / power automate calls (with collection) depending on amount selected

(1) ShareShare
ReportReport
Posted on by 80
I've got a PowerApp which is integrated in a PowerBI.
In the PowerBI I can select records until a max of 1000 (which is still the max for the integration i think).
In the PowerApp I am displaying the records in a gallery and I should be able to add a remark in 1 field and pass all as a json to a power automate flow.
As the flow will trigger a HTTP Call, I need to send batches of max 250 records. 

First I thought I had a solution (which was terrible, but worked, but apparently it doesnt work....)
In this case I would create a collection of the first 200 records and send this to my power automate. (also have it for third, fourth and fifth)
This works for my 1000 records, but when only 3 items are in the gallery it also executes this for all 5 galleries. 
There will be plenty of ideas for this i guess, but none of them come into my mind. Someone got an idea? 
 
If(IsError(ClearCollect(colFirst200ListItem,FirstN(ForAll(Gallery2.AllItems,{dataProcessingID:DataProcessingID,productID:ProductID,approverEmail:User().Email,userRemark:TextInput1_1.Text,approvalStatus:"Rejected",pricelistType:"Vendor",approvalTime:Text(Now(),DateTimeFormat.UTC)}),200))
),Notify("Error: Could not create the collection", NotificationType.Error));
If(CountRows(colFirst200ListItem)>0,
If(IsError(SendtoAPI.Run(JSON(colFirst200ListItem,JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes))),
Notify("Unexpected error happened, please send the following to : ",NotificationType.Error),Notify("Message sent successful!",NotificationType.Success););
);
If(IsError(ClearCollect(colSecond200ListItem,FirstN(LastN(ForAll(Gallery2.AllItems,{dataProcessingID:DataProcessingID,productID:ProductID,approverEmail:User().Email,userRemark:TextInput1_1.Text,approvalStatus:"Rejected",pricelistType:"Vendor",approvalTime:Text(Now(),DateTimeFormat.UTC)}),400),200))
),Notify("Error: Could not create the collection", NotificationType.Error));
If(CountRows(colSecond200ListItem)>0,
If(IsError(SendtoAPI.Run(JSON(colSecond200ListItem,JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes))),
Notify("Unexpected error happened, please send the following to : ",NotificationType.Error),Notify("Message sent successful!",NotificationType.Success););
);
 
Summary: I've got a gallery with 0-1000 records. When selecting a few it should create 1 collection and send it to powerbi, when selecting > 250 records it should send 2-5 collections to power automate. How can i create this in a much smarter and better way?
Categories:
I have the same question (0)

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard