Trigger the HTML output using Logic App

Abrar Adil S 401 Reputation points
2023-05-24T07:03:30.1366667+00:00

I have trigger a Azure API to retrieve the cost details, the output which has been provided I want to select the output and store it in a csv and send over an email, but unable to get the desired output.

Screenshot 2023-05-24 122806.png the Logic App workflow

Screenshot 2023-05-24 122905.png Output received through the email

Azure API : https://learn.microsoft.com/en-us/rest/api/cost-management/query/usage?tabs=HTTP#subscriptionquery-legacy

Screenshot 2023-05-24 123303.png body of the HTTP trigger

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 24,951 Reputation points Microsoft Employee Moderator
    2023-05-24T08:41:20.2433333+00:00

    @Abrar Adil S Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Based on above shared information, we have understood that you are trying to pull the usage report based on the resource type under a particular subscription using HTTP trigger and by creating a CSV table and post that sending the table as .csv file as an attachment in the email.

    To reproduce this behavior, we have created a consumption logic app with the below set of actions and triggers.

    User's image

    Here is the sample output for your reference:

    enter image description here

    Below are the expressions that we have used in Compose action and Create CSV Table action in our workflow.

    Compose action:

    "@body('Parse_JSON')?['properties']?['rows']"
    

    Create CSV table :

    PreTaxCost: @item()?[0]
    BillingMonth: @item()?[1]
    ResourceType:@item()?[2]
    Currency:@item()?[3]
    

    For more information, you can refer to this documentation, on how customize your CSV table in logic apps.
    Feel free to reach back to me if you have any further questions on this.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.