-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsend-DataToPowerAutomateAsJSON.pq
52 lines (52 loc) · 1.73 KB
/
send-DataToPowerAutomateAsJSON.pq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
let
output =
(link as text, JSONcontent as text) as text =>
let
URL = link,
headers = [
#"Content-Type" = "application/json"
],
send = {
(
Web.Contents(
URL,
[
Headers = headers,
Content = Text.ToBinary(JSONcontent)
]
)
)
},
tbl =
Table.AddColumn(
Table.FromList(
send,
Splitter.SplitByNothing(),
null,
null,
ExtraValues.Error
),
"send",
each
if [Column1] is binary then
"Sent"
else
"Something happened"
)
in
tbl{0}[send],
documentation = [
Documentation.Name = " send-DataToPowerAutomateAsJSON.pq ",
Documentation.Description = " Sending JSON structured data to Power Automate HTTP endpoint and returning TEXT value Send or Something happened",
Documentation.Source = "https://www.jaknapowerbi.cz . ",
Documentation.Version = " 1.0 ",
Documentation.Author = " Štěpán Rešl "
]
in
Value.ReplaceType(
output,
Value.ReplaceMetadata(
Value.Type(output),
documentation
)
)