cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sachy123
Regular Visitor

dynamic name of generated csv file.

Sachy123_0-1633083997488.png

 

So if you see, above is my flow, I want to ensure that the file name should have timestamp and report name and name of the user who has triggered the flow. 

so utcNow()_<Reportname>_<Username>.csv

 

I cant find how I can dynamically add the Reportname and Username ?

 

Any help would be appreciated!

Cheers

Sachy

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Sachy123,

 

In the response of the trigger action you should see something similar like this in the body. Can you check that in your flow history after testing the button?

 

"body": {
        "entity": {
            "Power BI values": [
                                 {
                                  "Report_Name": "YourReportName"
                                 }              
                               ]
                  }
        }

 

If that is the case you could use an expression like below:

triggerBody()?['entity']['Power BI values'][0]['Report_Name']

 

And if that is retrieving the report name value you could embed it in the concat function like below:

concat(utcNow('yyyy-MM-dd'), '_', triggerBody()?['entity']['Power BI values'][0]['Report_Name'], '_', triggerOutputs()['headers']['x-ms-user-name'], '.csv')

 

View solution in original post

7 REPLIES 7
Expiscornovus
Super User
Super User

Hi @Sachy123,

 

You could use an expression and use the trigger output of the Power BI button clicked action.

 

As far as I can see in the trigger inputs and outputs the report name is not available, only the user name.

 

However, you could use such an expression and hard-code the report name:

concat(utcNow('yyyy-MM-dd'), '_ReportName_', triggerOutputs()['headers']['x-ms-user-name'], '.csv')

 

Hope this helps a bit?

 

Sachy123
Regular Visitor

Yes it helps!

But I also want to have the report name to be generated . or maybe just file name of the power bi report.. is it possible?

Expiscornovus
Super User
Super User

Hi @Sachy123,

 

Like mentioned earlier, I don't see any value which relates back to the report where the button was clicked.

 

Only workaround I can think of is to included the report name in the data you are sending in the button click. This way you can retrieve it from the body/entity.

Ok , I will try it out

Sachy123
Regular Visitor

So , I created a measure " Report_Name" that has report name.. so how can I refer it in the power automate flow?

Expiscornovus
Super User
Super User

Hi @Sachy123,

 

In the response of the trigger action you should see something similar like this in the body. Can you check that in your flow history after testing the button?

 

"body": {
        "entity": {
            "Power BI values": [
                                 {
                                  "Report_Name": "YourReportName"
                                 }              
                               ]
                  }
        }

 

If that is the case you could use an expression like below:

triggerBody()?['entity']['Power BI values'][0]['Report_Name']

 

And if that is retrieving the report name value you could embed it in the concat function like below:

concat(utcNow('yyyy-MM-dd'), '_', triggerBody()?['entity']['Power BI values'][0]['Report_Name'], '_', triggerOutputs()['headers']['x-ms-user-name'], '.csv')

 

View solution in original post

great! I got the idea.  Actually I used the peek code to check the XMLs  but didnt do the check of the response of trigger output. how do I do that? 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (3,067)