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
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
Regards,
Yoshihiro Kawabata
Solved! Go to Solution.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
28 | |
27 | |
20 | |
10 |