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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ypyash75
Regular Visitor

Power Automate - Export to file for paginated report - dynamic fields

Hi,

 

Question regarding Power Automate and Power BI Service.
Is there any option to make fields for workspace name and report name dynamic in Power Automate - step Export to file for paginated report?
At the moment there is only dropdown list to select value. However, I have multiple reports in a workspace whihch I have to export in excel format. Would it be possible to use dynamic fields inside loop so that one flow goes over all reports and export all of them.

Please share example of dymamic content if possible please.

 

Thank You.

1 ACCEPTED SOLUTION

Hi @ypyash75 

The issue occurs because the indexOf() function is expecting a string, but an array was passed instead. To resolve this and correctly map Report IDs to Report Names, consider the below steps:

 

Instead of using separate arrays, create an object where Report ID is the key and Report Name is the value.Store this mapping in a Compose action or Object variable.

 

Use the Report ID from the loop and retrieve the corresponding Report Name using:

 

variables('ReportMapping')[items('Apply_to_each')]

 

Use the corrected expression to set the file name dynamically

 

concat(variables('ReportMapping')[items('Apply_to_each')], '_', formatDateTime(utcNow(), 'yyyyMMdd_HHmmss'), '.xlsx')

 

This ensures that files are saved using the correct Report Name instead of the Report ID.

 

If this post helps, please mark it as Accepted Solution. 

 

Thank You.

View solution in original post

6 REPLIES 6
v-karpurapud
Community Support
Community Support

Hi @ypyash75 

I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you.

v-karpurapud
Community Support
Community Support

Hi @ypyash75 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you.

 

v-karpurapud
Community Support
Community Support

Hi @ypyash75 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-karpurapud
Community Support
Community Support

Hello @ypyash75 


Thank you for reaching out to the Microsoft Community Fabric Forum.

 

To dynamically set the workspace name and report name in the "Export to File for Paginated Report" action in Power Automate, please follow these steps:

 

  1. Initialize two variables to store the workspace name and report name dynamically.

  2. Use the "List reports in a workspace" action to get all reports in the specified workspace. This will provide a list of reports to loop through.

  3. Add an "Apply to each" loop to iterate through the list of reports. Inside this loop, set the dynamic content for the report name.

  4. Within the loop, use the "Export to file for paginated report" action. Utilize the dynamic content from the loop to set the report name and workspace name.

In the "Export to File for Paginated Report" step:

 

-Value-@{items('Apply_to_each')?['workspace Name']}

-Value-@{items('Apply_to_each')?['Report Name']}

 

If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

 

Thank you!

Hi @v-karpurapud  thanks a lot for your time.  I just realised that export action recognized report ID rather than when we pass multiple values in the variable. I did the same, I created:

 

1. array variables storing report IDs

2. used the apply to each loop for getting the IDs from the array using export to files for paginated reports action.

3. trying to save the files on sharepoint, but file name is coming as report ID wherein I need the report name as file name.

4. in order to to that, I created another array variable having report names ans using below expression to get the file name mapped to the ID

 

concat(variables('ReportNames')[indexOf(variables('ReportGUIDs'), items('Apply_to_each'))], '_', formatDateTime(utcNow(), 'yyyyMMdd_HHmmss'), '.xlsx')

 

unfortunately, I am getting the below error while running the flow:

 

Unable to process template language expressions in action 'Create_file' inputs at line '0' and column '0': 'The template language function 'indexOf' expects its first parameter to be of type string. The provided value is of type 'Array'. Please see https://aka.ms/logicexpressions#indexof for usage details.'.

 

Hi @ypyash75 

The issue occurs because the indexOf() function is expecting a string, but an array was passed instead. To resolve this and correctly map Report IDs to Report Names, consider the below steps:

 

Instead of using separate arrays, create an object where Report ID is the key and Report Name is the value.Store this mapping in a Compose action or Object variable.

 

Use the Report ID from the loop and retrieve the corresponding Report Name using:

 

variables('ReportMapping')[items('Apply_to_each')]

 

Use the corrected expression to set the file name dynamically

 

concat(variables('ReportMapping')[items('Apply_to_each')], '_', formatDateTime(utcNow(), 'yyyyMMdd_HHmmss'), '.xlsx')

 

This ensures that files are saved using the correct Report Name instead of the Report ID.

 

If this post helps, please mark it as Accepted Solution. 

 

Thank You.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors