I am creating a Custom Connector inside Power Automate and Power Apps, and inside the Actions section, i am building the responses objects by importing a sample JSON as follow:-
Here is the JSON sample i applied:-
{
"content": [
{
"id": 1,
"payments": [
{
"id": 15,
"evidenceId": 1,
"purpose": "INVOICE",
"reference": "sdfaasdfasdf",
"beneficiary": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"dueDate": null,
"amountToPay": 12,
"amountDue": 89,
"currency": "GBP",
"payerDetailsResponse": {
"id": 1,
"institutionId": "modelo-sandbox",
"institutionName": "Modelo Sandbox",
"bulkAvailable": true,
"maxBulkPayments": 50,
"minBulkPayments": 2,
"iban": null,
"bic": null,
"sortCode": "700001",
"accountNumber": "70000001",
"balance": -1234500801.09,
"currency": "GBP"
},
"state": "COMPLETED",
"initiationDate": "2022-02-04T14:06:23",
"statusLastChanged": "2022-02-04T14:08:05",
"statusLastChecked": "2022-02-04T14:08:05"
},
{
"id": 14,
"evidenceId": 1,
"purpose": "INVOICE",
"reference": "asdfasqwerqwer",
"beneficiary": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"dueDate": null,
"amountToPay": 1,
"amountDue": 89,
"currency": "GBP",
"payerDetailsResponse": {
"id": 1,
"institutionId": "modelo-sandbox",
"institutionName": "Modelo Sandbox",
"bulkAvailable": true,
"maxBulkPayments": 50,
"minBulkPayments": 2,
"iban": null,
"bic": null,
"sortCode": "700001",
"accountNumber": "70000001",
"balance": -1234500801.09,
"currency": "GBP"
},
"state": "COMPLETED",
"initiationDate": "2022-02-04T11:26:30",
"statusLastChanged": "2022-02-04T11:27:47",
"statusLastChecked": "2022-02-04T11:27:47"
},
{
"id": 13,
"evidenceId": 1,
"purpose": "INVOICE",
"reference": "petyavasyakatya",
"beneficiary": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"dueDate": null,
"amountToPay": 1,
"amountDue": 89,
"currency": "GBP",
"payerDetailsResponse": {
"id": 1,
"institutionId": "modelo-sandbox",
"institutionName": "Modelo Sandbox",
"bulkAvailable": true,
"maxBulkPayments": 50,
"minBulkPayments": 2,
"iban": null,
"bic": null,
"sortCode": "700001",
"accountNumber": "70000001",
"balance": -1234500801.09,
"currency": "GBP"
},
"state": "COMPLETED",
"initiationDate": "2022-02-04T11:22:05",
"statusLastChanged": "2022-02-04T11:23:14",
"statusLastChecked": "2022-02-04T11:23:14"
}
],
"supplier": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"beneficiary": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"evidences": [
{
"id": 1,
"evidenceType": "INVOICE",
"storedFileFolder": "temp",
"storedFileId": 3,
"lineItems": [
{
"id": 1,
"externalId": null,
"externalAccountID": null,
"description": "",
"quantity": null,
"unitAmount": null,
"currency": null,
"itemCode": null,
"accountCode": null,
"accountName": null,
"taxType": null,
"taxAmount": null,
"lineAmount": null,
"discountRate": null,
"discountAmount": null,
"totalAmount": null,
"subtotalAmount": null
}
],
"currency": "GBP",
"total": 102,
"subtotal": 100,
"taxAmount": null,
"issueDate": "2022-01-31",
"purchaseOrderNumber": null,
"purchaseDeliveryDate": null,
"purchaseExpectedDeliveryDate": null,
"purchasePaymentDueDate": null,
"invoiceReference": "",
"invoiceDueDate": null,
"deliveryNote": null,
"deliveryDate": null,
"transactionClearedOnDate": null,
"transactionDescription": null,
"payrollSource": null,
"payrollReference": null
},
{
"id": 1002,
"evidenceType": "PAYMENT_TRANSACTION",
"storedFileFolder": null,
"storedFileId": null,
"lineItems": [],
"currency": "GBP",
"total": 1,
"subtotal": null,
"taxAmount": null,
"issueDate": null,
"purchaseOrderNumber": null,
"purchaseDeliveryDate": null,
"purchaseExpectedDeliveryDate": null,
"purchasePaymentDueDate": null,
"invoiceReference": null,
"invoiceDueDate": null,
"deliveryNote": null,
"deliveryDate": null,
"transactionClearedOnDate": "2022-02-04T11:27:47",
"transactionDescription": null,
"payrollSource": {},
"payrollReference": null
},
{
"id": 1003,
"evidenceType": "PAYMENT_TRANSACTION",
"storedFileFolder": null,
"storedFileId": null,
"lineItems": [],
"currency": "GBP",
"total": 12,
"subtotal": null,
"taxAmount": null,
"issueDate": null,
"purchaseOrderNumber": null,
"purchaseDeliveryDate": null,
"purchaseExpectedDeliveryDate": null,
"purchasePaymentDueDate": null,
"invoiceReference": null,
"invoiceDueDate": null,
"deliveryNote": null,
"deliveryDate": null,
"transactionClearedOnDate": "2022-02-04T14:08:05",
"transactionDescription": null,
"payrollSource": null,
"payrollReference": null
}
]
},
{
"id": 2,
"payments": [
{
"id": 16,
"evidenceId": 2,
"purpose": "INVOICE",
"reference": "sdfaasdfasdf",
"beneficiary": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"dueDate": null,
"amountToPay": 12,
"amountDue": 89,
"currency": "GBP",
"payerDetailsResponse": {
"id": 1,
"institutionId": "modelo-sandbox",
"institutionName": "Modelo Sandbox",
"bulkAvailable": true,
"maxBulkPayments": 50,
"minBulkPayments": 2,
"iban": null,
"bic": null,
"sortCode": "700001",
"accountNumber": "70000001",
"balance": -1234500801.09,
"currency": "GBP"
},
"state": "COMPLETED",
"initiationDate": "2022-02-04T14:06:23",
"statusLastChanged": "2022-02-04T14:08:05",
"statusLastChecked": "2022-02-04T14:08:05"
},
{
"id": 17,
"evidenceId": 2,
"purpose": "INVOICE",
"reference": "asdfasqwerqwer",
"beneficiary": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"dueDate": null,
"amountToPay": 1,
"amountDue": 89,
"currency": "GBP",
"payerDetailsResponse": {
"id": 1,
"institutionId": "modelo-sandbox",
"institutionName": "Modelo Sandbox",
"bulkAvailable": true,
"maxBulkPayments": 50,
"minBulkPayments": 2,
"iban": null,
"bic": null,
"sortCode": "700001",
"accountNumber": "70000001",
"balance": -1234500801.09,
"currency": "GBP"
},
"state": "COMPLETED",
"initiationDate": "2022-02-04T11:26:30",
"statusLastChanged": "2022-02-04T11:27:47",
"statusLastChecked": "2022-02-04T11:27:47"
},
{
"id": 18,
"evidenceId": 2,
"purpose": "INVOICE",
"reference": "petyavasyakatya",
"beneficiary": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"dueDate": null,
"amountToPay": 1,
"amountDue": 89,
"currency": "GBP",
"payerDetailsResponse": {
"id": 1,
"institutionId": "modelo-sandbox",
"institutionName": "Modelo Sandbox",
"bulkAvailable": true,
"maxBulkPayments": 50,
"minBulkPayments": 2,
"iban": null,
"bic": null,
"sortCode": "700001",
"accountNumber": "70000001",
"balance": -1234500801.09,
"currency": "GBP"
},
"state": "COMPLETED",
"initiationDate": "2022-02-04T11:22:05",
"statusLastChanged": "2022-02-04T11:23:14",
"statusLastChecked": "2022-02-04T11:23:14"
}
],
"supplier": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"beneficiary": {
"id": 12,
"name": "A R C Car Wash",
"email": "ja@bra.com",
"phone": "",
"trusted": false,
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
],
"externalId": "5902be62-72f9-4a04-9aa7-cb112de665ab",
"taxResidency": null,
"nationalId": null,
"digitalId": null,
"registrationId": null,
"vatId": null,
"lei": null,
"type": "ORGANISATION"
},
"evidences": [
{
"id": 2,
"evidenceType": "INVOICE",
"storedFileFolder": "temp",
"storedFileId": 3,
"lineItems": [
{
"id": 2,
"externalId": null,
"externalAccountID": null,
"description": "",
"quantity": null,
"unitAmount": null,
"currency": null,
"itemCode": null,
"accountCode": null,
"accountName": null,
"taxType": null,
"taxAmount": null,
"lineAmount": null,
"discountRate": null,
"discountAmount": null,
"totalAmount": null,
"subtotalAmount": null
}
],
"currency": "GBP",
"total": 102,
"subtotal": 100,
"taxAmount": null,
"issueDate": "2022-01-31",
"purchaseOrderNumber": null,
"purchaseDeliveryDate": null,
"purchaseExpectedDeliveryDate": null,
"purchasePaymentDueDate": null,
"invoiceReference": "",
"invoiceDueDate": null,
"deliveryNote": null,
"deliveryDate": null,
"transactionClearedOnDate": null,
"transactionDescription": null,
"payrollSource": null,
"payrollReference": null
},
{
"id": 1012,
"evidenceType": "PAYMENT_TRANSACTION",
"storedFileFolder": null,
"storedFileId": null,
"lineItems": [],
"currency": "GBP",
"total": 1,
"subtotal": null,
"taxAmount": null,
"issueDate": null,
"purchaseOrderNumber": null,
"purchaseDeliveryDate": null,
"purchaseExpectedDeliveryDate": null,
"purchasePaymentDueDate": null,
"invoiceReference": null,
"invoiceDueDate": null,
"deliveryNote": null,
"deliveryDate": null,
"transactionClearedOnDate": "2022-02-04T11:27:47",
"transactionDescription": null,
"payrollSource": {},
"payrollReference": null
},
{
"id": 1013,
"evidenceType": "PAYMENT_TRANSACTION",
"storedFileFolder": null,
"storedFileId": null,
"lineItems": [],
"currency": "GBP",
"total": 12,
"subtotal": null,
"taxAmount": null,
"issueDate": null,
"purchaseOrderNumber": null,
"purchaseDeliveryDate": null,
"purchaseExpectedDeliveryDate": null,
"purchasePaymentDueDate": null,
"invoiceReference": null,
"invoiceDueDate": null,
"deliveryNote": null,
"deliveryDate": null,
"transactionClearedOnDate": "2022-02-04T14:08:05",
"transactionDescription": null,
"payrollSource": null,
"payrollReference": null
}
]
}
],
"pageable": {
"sort": {
"empty": true,
"sorted": false,
"unsorted": true
},
"offset": 0,
"pageNumber": 0,
"pageSize": 10,
"paged": true,
"unpaged": false
},
"last": true,
"totalPages": 1,
"totalElements": 2,
"size": 10,
"number": 0,
"sort": {
"empty": true,
"sorted": false,
"unsorted": true
},
"first": true,
"numberOfElements": 10,
"empty": false
}
but this what i get:-
so a lot of properties are missing such as the "PaymentDetails".. so how i can build the responses objects inside the custom connector for our JSON sample?
Thanks
paymentDetails
contains many nested fields. if you nested those fields in paymentDetails
as a JSON object, it would work automatically.
Change this:
"paymentDetails": [
{
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}
]
to:
"paymentDetails": {
"id": null,
"currency": null,
"sortCode": "30-30-30",
"accountNumber": "35353535",
"iban": null,
"bic": null,
"abartn": null,
"ifscCode": null,
"type": "SC",
"address": null
}