{
"type": "OpenApiConnectionWebhook",
"inputs": {
"parameters": {
"subscriptionRequest/message": 3,
"subscriptionRequest/entityname": "new_deal",
"subscriptionRequest/scope": 4,
"subscriptionRequest/filteringattributes": "statecode"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
"connection": "shared_commondataserviceforapps",
"operationId": "SubscribeWebhookTrigger"
}
},
"conditions": [
{
"expression": "@greater(addSeconds(utcNow(), -10), triggerOutputs()?['body/cr239_inactivedate'])"
}
],
"runtimeConfiguration": {
"concurrency": {
"runs": 3
}
}
}
List Rows:
{
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"entityName": "new_deals",
"$filter": "new_dealid eq '@{triggerOutputs()?['body/new_dealid']}'"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
"connection": "shared_commondataserviceforapps",
"operationId": "ListRecords"
}
},
"runAfter": {}
}
For Each:
{
"type": "Foreach",
"foreach": "@outputs('List_rows')?['body/value']",
"actions": {
"Condition": {
"type": "If",
"expression": {
"and": [
{
"equals": [
"@items('For_each')?['statecode']",
1
]
}
]
},
"actions": {
"Current_time": {
"type": "Expression",
"kind": "CurrentTime",
"inputs": {}
},
"Upsert_a_row": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"entityName": "new_deals",
"recordId": "@items('For_each')?['new_dealid']",
"item/cr239_inactivedate": "@body('Current_time')"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
"connection": "shared_commondataserviceforapps",
"operationId": "UpdateRecord"
}
},
"runAfter": {
"Current_time": [
"Succeeded"
]
}
}
},
"else": {
"actions": {
"Upsert_a_row_1": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"entityName": "new_deals",
"recordId": "@items('For_each')?['new_dealid']",
"item/cr239_inactivedate": "@null"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
"connection": "shared_commondataserviceforapps",
"operationId": "UpdateRecord"
}
}
}
}
}
}
},
"runAfter": {
"List_rows": [
"Succeeded"
]
},
"runtimeConfiguration": {
"concurrency": {
"repetitions": 1
}
}
}
Condition:
{
"type": "If",
"expression": {
"and": [
{
"equals": [
"@items('For_each')?['statecode']",
1
]
}
]
},
"actions": {
"Current_time": {
"type": "Expression",
"kind": "CurrentTime",
"inputs": {}
},
"Upsert_a_row": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"entityName": "new_deals",
"recordId": "@items('For_each')?['new_dealid']",
"item/cr239_inactivedate": "@body('Current_time')"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
"connection": "shared_commondataserviceforapps",
"operationId": "UpdateRecord"
}
},
"runAfter": {
"Current_time": [
"Succeeded"
]
}
}
},
"else": {
"actions": {
"Upsert_a_row_1": {
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"entityName": "new_deals",
"recordId": "@items('For_each')?['new_dealid']",
"item/cr239_inactivedate": "@null"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
"connection": "shared_commondataserviceforapps",
"operationId": "UpdateRecord"
}
}
}
}
}
}
[IF TRUE]
Current time:
{
"type": "Expression",
"kind": "CurrentTime",
"inputs": {}
}
Upsert a row:
{
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"entityName": "new_deals",
"recordId": "@items('For_each')?['new_dealid']",
"item/cr239_inactivedate": "@body('Current_time')"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
"connection": "shared_commondataserviceforapps",
"operationId": "UpdateRecord"
}
},
"runAfter": {
"Current_time": [
"Succeeded"
]
}
}
[IF FALSE]
Upsert a row 1:
{
"type": "OpenApiConnection",
"inputs": {
"parameters": {
"entityName": "new_deals",
"recordId": "@items('For_each')?['new_dealid']",
"item/cr239_inactivedate": "@null"
},
"host": {
"apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps",
"connection": "shared_commondataserviceforapps",
"operationId": "UpdateRecord"
}
}
}