Hello!
Im getting from PowerAutomate to a PowerApps a response of an array like this:
[
[
"ReceiptTime:May 18 2021 12:51:23",
"Usuario:jbaca",
"IPOrigen:10.10.52.145",
"IPDestino:10.10.52.51",
"AccountCustomEntity:10.10.52.51"
],
[
"ReceiptTime:May 18 2021 12:51:35",
"Usuario:jbaca",
"IPOrigen:10.10.52.145",
"IPDestino:10.10.52.51",
"AccountCustomEntity:10.10.52.51"
],
[
"ReceiptTime:May 18 2021 12:51:59",
"Usuario:jbaca",
"IPOrigen:10.10.52.145",
"IPDestino:10.10.52.51",
"AccountCustomEntity:10.10.52.51"
]
]
All of the strings are with this format "key:value"
Sometimes i will recieve more items or different KEY:VALUES like this:
[
[
"Account:ABC\\ABC",
"Computer:EQ-DC02.ABC.LOCAL",
"IpAddress:99999",
"AccountType:User",
"Activity:4624 - An account was successfully logged on.",
"LogonTypeName:10 - RemoteInteractive",
"ProcessName:C:\\Windows\\System32\\svchost.exe",
"StartTimeUtc:2021-05-18T14:59:13.063Z",
"EndTimeUtc:2021-05-18T14:59:13.063Z",
"ConnectinCount:2",
"timestamp:2021-05-18T14:59:13.063Z",
"AccountCustomEntity:ABC",
"HostCustomEntity:EQ-DC02.ABC.LOCAL",
"IPCustomEntity:10.10.52.149"
],
[
"Account:ABC\\ABC",
"Computer:EQ-DC02.ABC.LOCAL",
"IpAddress:99999",
"AccountType:User",
"Activity:4624 - An account was successfully logged on.",
"LogonTypeName:10 - RemoteInteractive",
"ProcessName:C:\\Windows\\System32\\svchost.exe",
"StartTimeUtc:2021-05-18T14:59:13.063Z",
"EndTimeUtc:2021-05-18T14:59:13.063Z",
"ConnectinCount:2",
"timestamp:2021-05-18T14:59:13.063Z",
"AccountCustomEntity:ABC",
"HostCustomEntity:EQ-DC02.ABC.LOCAL",
"IPCustomEntity:10.10.52.149"
], [
"Account:ABC\\ABC",
"Computer:EQ-DC02.ABC.LOCAL",
"IpAddress:99999",
"AccountType:User",
"Activity:4624 - An account was successfully logged on.",
"LogonTypeName:10 - RemoteInteractive",
"ProcessName:C:\\Windows\\System32\\svchost.exe",
"StartTimeUtc:2021-05-18T14:59:13.063Z",
"EndTimeUtc:2021-05-18T14:59:13.063Z",
"ConnectinCount:2",
"timestamp:2021-05-18T14:59:13.063Z",
"AccountCustomEntity:ABC",
"HostCustomEntity:EQ-DC02.ABC.LOCAL",
"IPCustomEntity:10.10.52.149"
], [
"Account:ABC\\ABC",
"Computer:EQ-DC02.ABC.LOCAL",
"IpAddress:99999",
"AccountType:User",
"Activity:4624 - An account was successfully logged on.",
"LogonTypeName:10 - RemoteInteractive",
"ProcessName:C:\\Windows\\System32\\svchost.exe",
"StartTimeUtc:2021-05-18T14:59:13.063Z",
"EndTimeUtc:2021-05-18T14:59:13.063Z",
"ConnectinCount:2",
"timestamp:2021-05-18T14:59:13.063Z",
"AccountCustomEntity:ABC",
"HostCustomEntity:EQ-DC02.ABC.LOCAL",
"IPCustomEntity:10.10.52.149"
]
]
My Question is: is possible to convert this array of data to a Collection to show it in a gallery
Or convert it in a json to later parse and convert in a Collection?
Solved! Go to Solution.
Hi @madmvx :
The schema of the two arrays you provide is the same, they are both:
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
}
Best Regards,
Bof
Hi @madmvx :
PowerApps cannot directly parse the array text, especially the data structure of your array changes dynamically.
I suggest you modify your flow and return your array to your canvas in array format (not in text format). Because flow can directly return the array to the canvas.
The specific action is "Response"
I think this link will help you a lot:
Return an Array from Flow to PowerApps (Response Method)
Best Regards,
Bof
Hello @v-bofeng-msft, the problem is "response" needs a Json Schema
And the data y dynamic so the schema will never gonna be the same, so what can I do to solve that?
Hi @madmvx :
The schema of the two arrays you provide is the same, they are both:
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
}
Best Regards,
Bof
@v-bofeng-msft Thanks so much, im gonna test that, but first i need to change that array?
[
{
"ReceiptTime:May 18 2021 12:51:23",
"Usuario:jbaca",
"IPOrigen:10.10.52.145",
"IPDestino:10.10.52.51",
"AccountCustomEntity:10.10.52.51"
},
{
"ReceiptTime:May 18 2021 12:51:35",
"Usuario:jbaca",
"IPOrigen:10.10.52.145",
"IPDestino:10.10.52.51",
"AccountCustomEntity:10.10.52.51"
},
{
"ReceiptTime:May 18 2021 12:51:59",
"Usuario:jbaca",
"IPOrigen:10.10.52.145",
"IPDestino:10.10.52.51",
"AccountCustomEntity:10.10.52.51"
}
]
To something like this?
or i can pass the array normally? and the schema detect it?
and take in consideration the elements in my array are
"key:value"
not
key:"value"
How can i change it?
Hi @madmvx :
I suggest you just try it first.
According to the json text you provided, the result will be
"ReceiptTime:May 18 2021 12:51:23"
instead of
ReceiptTime:"May 18 2021 12:51:23"
Best Regards,
Bof
@v-bofeng-msft it works! thank you so much, but now im gettin like this the collection:
How can i put this to a Gallery?
Hi @madmvx :
Create a Gallery(Gallery1) and set it's items property to:
CollectionOfEventsT
Create a sub Gallery(Gallery2) into Gallery1 and set it's items property to:
Thisitem.Value
Best Reagrds,
Bof