
Struggling to retrieve a massive dataset of 100,000 records in Power Automate? π Hereβs a comprehensive guide to help you manage this effectively:
Step-by-Step Guide:
Get Items:
Action: Select the SharePoint Site.
Order By: ID desc.
Initialize Variables:
LastRecordID: Integer: first(outputs('Get_items')?['body/value'])?['ID']
CountMul5000Record: Integer: Set to 0.
Configure Do Until Loop:
Condition: CountMul5000Record is greater than or equal to LastRecordID.
Count: Set to 5000.
Timeout: Set to PT1H.
Set Up HTTP Request:
Method: GET.
URI: Use the SharePoint API to fetch records in batches.
_api/web/lists_getbytitle('list Name')/items?$select=ID,Title&$filter=ID ge CountMul5000Record and ID le add(variables('CountMul5000Record'),5000))&$top=5000
Select Results:
Use the Select action to get the results from the HTTP request.
body('HTTP')?['d']?['results']
Increase Counter:
Increment CountMul5000Record by 5000.
Calculate Total Records:
Use the length function to get the total number of records.
length(body('Select'))
If you want to do a compose to get the total count using the Total records variable outside the do until loop
π§ Pro Tips:
Batch Processing: Ensure your API call and variables are correctly set up to handle large datasets.
Performance Monitoring: Monitor the flow to handle potential timeouts and errors.
Efficient Loop Configuration: Optimize the loop settings for smoother execution.
With this robust approach, you can effectively handle and retrieve up to 100,000 records in Power Automate. Happy Automating! π
#PowerAutomate #SharePoint #Automation #PowerPlatform #RPA #DataManagement