cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
yoshihirok
Level 10

Tips - Record data from PowerShell script to Excel by Microsoft Flow

I want to share a tips to record data from PowerShell script to Excel by Microsoft Flow.

 

Summary:

When a PowerShell script run with data, add the data to Excel file on OneDrive for Business.

 

Use Scenario:

Record data to Excel from PowerShell.

 

Flow overview:
Trigger : Request - When a HTTP request is received

Action : Excel Online (Business) - Add a row into a table

2018-08-12 (1).png 

Enter or paste a sample JSON payload for sending from a PowerShell script

{
 "Name": "a",
 "Value": 100
}

 

Request Body JSON Schema for trigger

{
    "type": "object",
    "properties": {
        "Name": {
            "type": "string"
        },
        "Value": {
            "type": "integer"
        }
    }
}

PowerShell script

$endpoint = ""
$payload = @{
"Name" ="A"
"Value" =100
}
Invoke-RestMethod -Method Post -Uri $endpoint -Body (ConvertTo-Json $payload) -ContentType 'application/json'

Please set $endpost to HTTP POST URL of trigger.

 

Excel file prepare before run the PowerShell script

1. Enter "Name" to A1 cell

2. Enter "Value" to B1 cell

3. Format as table

2018-08-12 (2).png 

Regards,

Yoshihiro Kawabata

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Tips - Record data from PowerShell script to Excel by Microsoft Flow

Hi @yoshihirok,

 

Thanks for your sharing.

 

Best regards,

Alice

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Tips - Record data from PowerShell script to Excel by Microsoft Flow

Hi @yoshihirok,

 

Thanks for your sharing.

 

Best regards,

Alice

View solution in original post

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,840)