stefanstranger / logicappdocs

Generate technical Markdown documentation for your Azure Logic App and Power Automate Flows
MIT License
55 stars 4 forks source link

Substring" with "2" argument(s): "Length cannot be less than zero. (Parameter 'length') #26

Closed acieslik closed 8 months ago

acieslik commented 1 year ago

When using this logic app definition the Helper function GetAction will fail, as for some reason an array of actions return instead of one currentAction as the name implies: Where-Object: C:\Repos\github\logicappdocsac\src\Helper.ps1:173:76 Line | 173 | … ($Actions | Where-Object { $.RunAfter -eq $(('{0}-False') -f $(($cur … | ~~~~~~~~~~~~~ | Exception calling "Substring" with "2" argument(s): "Length cannot be less than zero. (Parameter 'length')"

(security related data was replaced with fake names or numbers):

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Get_apikey": {
                "inputs": {
                    "host": {
                        "connection": {
                            "name": "@parameters('$connections')['keyvault']['connectionId']"
                        }
                    },
                    "method": "get",
                    "path": "/secrets/@{encodeURIComponent('mykey')}/value"
                },
                "runAfter": {
                    "Initialize_processid": [
                        "Succeeded"
                    ]
                },
                "type": "ApiConnection"
            },
            "Initialize_apikey": {
                "inputs": {
                    "variables": [
                        {
                            "name": "apikey",
                            "type": "string",
                            "value": "@body('Get_apikey')?['value']"
                        }
                    ]
                },
                "runAfter": {
                    "Get_apikey": [
                        "Succeeded"
                    ]
                },
                "type": "InitializeVariable"
            },
            "Initialize_processid": {
                "inputs": {
                    "variables": [
                        {
                            "name": "processid",
                            "type": "String",
                            "value": "@triggerBody()['processid']"
                        }
                    ]
                },
                "runAfter": {
                    "init_uri": [
                        "Succeeded"
                    ]
                },
                "type": "InitializeVariable"
            },
            "async_response": {
                "inputs": {
                    "body": {},
                    "schema": {
                        "properties": {},
                        "type": "object"
                    },
                    "statusCode": 200
                },
                "kind": "Http",
                "runAfter": {
                    "Initialize_apikey": [
                        "Succeeded"
                    ]
                },
                "type": "Response"
            },
            "init_baseuri": {
                "description": "The base uri for sap webservice.",
                "inputs": {
                    "variables": [
                        {
                            "name": "baseUri",
                            "type": "String",
                            "value": "https://sapservices/api/"
                        }
                    ]
                },
                "runAfter": {},
                "type": "InitializeVariable"
            },
            "init_uri": {
                "description": "Create the complete request uri for the sap webservice.",
                "inputs": {
                    "variables": [
                        {
                            "name": "uri",
                            "type": "String",
                            "value": "@{variables('baseUri')}@{triggerBody()?['operationName']}"
                        }
                    ]
                },
                "runAfter": {
                    "init_baseuri": [
                        "Succeeded"
                    ]
                },
                "type": "InitializeVariable"
            },
            "sap_service_invoke": {
                "actions": {
                    "Invoke_sap_webservice": {
                        "inputs": {
                            "body": {
                                "AccountNumber": "@{triggerBody()?['AccountNumber']}",
                                "EntityId": "@{triggerBody()?['EntityId']}",
                                "EntityLogicalName": "@{triggerBody()?['EntityLogicalName']}",
                                "QuoteId": "@{triggerBody()?['QuoteId']}",
                                "SalesOrg": "@{triggerBody()?['SalesOrg']}",
                                "userId": "@{triggerBody()?['userId']}"
                            },
                            "headers": {
                                "Content-Type": "application/json",
                                "Ocp-Apim-Subscription-Key": "@variables('apikey')",
                                "Ocp-Apim-Trace": "true"
                            },
                            "method": "POST",
                            "retryPolicy": {
                                "type": "none"
                            },
                            "uri": "@variables('uri')"
                        },
                        "runAfter": {},
                        "type": "Http"
                    },
                    "Parse_sap_webservice_response_body": {
                        "inputs": {
                            "content": "@body('Invoke_sap_webservice')",
                            "schema": {
                                "properties": {
                                    "ErrorMessage": {},
                                    "HasOrderBlock": {
                                        "type": "boolean"
                                    },
                                    "Success": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "runAfter": {
                            "Invoke_sap_webservice": [
                                "Succeeded"
                            ]
                        },
                        "type": "ParseJson"
                    }
                },
                "runAfter": {
                    "Initialize_apikey": [
                        "Succeeded"
                    ]
                },
                "type": "Scope"
            },
            "sap_service_invoke_failed": {
                "actions": {
                    "update_process_failed": {
                        "inputs": {
                            "body": {
                                "_ownerid_type": "",
                                "test_log": "@{body('Parse_sap_webservice_response_body')?['ErrorMessage']}",
                                "test_processstatus": 135790003
                            },
                            "host": {
                                "connection": {
                                    "name": "@parameters('$connections')['commondataservice_1']['connectionId']"
                                }
                            },
                            "method": "patch",
                            "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('democrm'))}/tables/@{encodeURIComponent(encodeURIComponent('test_longrunningprocesses'))}/items/@{encodeURIComponent(encodeURIComponent(variables('processid')))}"
                        },
                        "runAfter": {},
                        "type": "ApiConnection"
                    }
                },
                "runAfter": {
                    "sap_service_invoke": [
                        "TimedOut",
                        "Failed"
                    ]
                },
                "type": "Scope"
            },
            "sap_service_invoke_succeeded": {
                "actions": {
                    "update_process_succeeded": {
                        "inputs": {
                            "body": {
                                "_ownerid_type": "",
                                "test_processstatus": 135790002,
                                "test_response": "@{body('Invoke_sap_webservice')}"
                            },
                            "host": {
                                "connection": {
                                    "name": "@parameters('$connections')['commondataservice_1']['connectionId']"
                                }
                            },
                            "method": "patch",
                            "path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('democrm'))}/tables/@{encodeURIComponent(encodeURIComponent('test_longrunningprocesses'))}/items/@{encodeURIComponent(encodeURIComponent(variables('processid')))}"
                        },
                        "runAfter": {},
                        "type": "ApiConnection"
                    }
                },
                "runAfter": {
                    "sap_service_invoke_failed": [
                        "Skipped"
                    ]
                },
                "type": "Scope"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {
            "$connections": {
                "defaultValue": {},
                "type": "Object"
            }
        },
        "triggers": {
            "manual": {
                "inputs": {
                    "schema": {
                        "properties": {
                            "AccountNumber": {},
                            "EntityId": {
                                "type": "string"
                            },
                            "EntityLogicalName": {
                                "type": "string"
                            },
                            "QuoteId": {
                                "type": "string"
                            },
                            "SalesOrg": {
                                "type": "string"
                            },
                            "UserId": {
                                "type": "string"
                            },
                            "operationName": {
                                "type": "string"
                            },
                            "processId": {
                                "type": "string"
                            }
                        },
                        "type": "object"
                    }
                },
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "parameters": {
        "$connections": {
            "value": {
                "commondataservice_1": {
                    "connectionId": "/subscriptions/12378888-ce3e-456b-92c9-54e214015111/resourceGroups/test/providers/Microsoft.Web/connections/commondataservice",
                    "connectionName": "commondataservice",
                    "id": "/subscriptions/12378888-ce3e-456b-92c9-54e214015111/providers/Microsoft.Web/locations/westeurope/managedApis/commondataservice"
                },
                "keyvault": {
                    "connectionId": "/subscriptions/12378888-ce3e-456b-92c9-54e214015111/resourceGroups/test/providers/Microsoft.Web/connections/keyvault",
                    "connectionName": "keyvault",
                    "id": "/subscriptions/12378888-ce3e-456b-92c9-54e214015111/providers/Microsoft.Web/locations/westeurope/managedApis/keyvault"
                }
            }
        }
    }
}
hsncrook commented 1 year ago

I'm getting the same error as @acieslik

This is my logic app

(security related data was replaced with fake names or numbers):

{ "definition": { "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", "actions": { "Catch": { "actions": { "ExtractLogicAppError": { "inputs": { "body": { "LogicAppName": "@{workflow().name}", "ResourceGroup": "site-provisioning-kg-rg", "Runid": "@{workflow().run.name}", "SubscriptionId": "11111q1z-76b3-45ba-a4c1-c7d3b4a53e13" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/customer-automation-rg/providers/Microsoft.Web/sites/fa-customer-automation-helper-dotnet/functions/ExtractLogicAppError" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" }, "set_intResponseCode_Catch": { "inputs": { "name": "intResponseCode", "value": 500 }, "runAfter": { "ExtractLogicAppError": [ "Succeeded" ] }, "type": "SetVariable" }, "set_strResponseText_Catch": { "inputs": { "name": "strResponseText", "value": "@{first(body('ExtractLogicAppError'))?['errorMessage']}" }, "runAfter": { "set_intResponseCode_Catch": [ "Succeeded" ] }, "type": "SetVariable" } }, "runAfter": { "Try": [ "Failed", "TimedOut" ] }, "type": "Scope" }, "Finally": { "actions": { "Condition": { "actions": { "la-createATTicket": { "inputs": { "body": { "companyID": 0, "contactMail": "xxxx.xxxx@xxxx.nl", "defaultContactID": 30686628, "dueDateTime": "@body('setDueDateTime')", "priority": 3, "queueID": 29683484, "status": 1, "ticketCategory": 2, "ticketDescription": "Logic app voor het maken van een klantensite is mislukt. Runid: @{workflow().run.name}\n\nhttps://portal.azure.com/#view/Microsoft_Azure_EMA/LogicAppsMonitorBlade/runid/%2Fsubscriptions%2F11111q1z-76b3-45ba-a4c1-c7d3b4a53e13%2Fresourcegroups%2Fsite-provisioning-kg-rg%2Fproviders%2FMicrosoft.Logic%2Fworkflows%2F@{workflow().name}%2Fruns%2F@{workflow().run.name}", "ticketTitle": "Fout opgetreden in logic app: @{workflow().name}" }, "host": { "triggerName": "manual", "workflow": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/customer-automation-rg/providers/Microsoft.Logic/workflows/la-createATTicket" } } }, "runAfter": { "setDueDateTime": [ "Succeeded" ] }, "type": "Workflow" }, "setDueDateTime": { "inputs": { "baseTime": "@{addDays(utcNow(),2)}", "destinationTimeZone": "W. Europe Standard Time", "formatString": "yyyy-MM-ddTHH:mm:ss", "sourceTimeZone": "UTC" }, "kind": "ConvertTimeZone", "runAfter": {}, "type": "Expression" } }, "else": { "actions": { "markCustomerAsComplete": { "inputs": { "body": { "Title": "@{first(body('parseCompany')?['item']?['companyName'])}", "gi_x002d_complete": true }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "patch", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/tables/@{encodeURIComponent(encodeURIComponent('06604a18-d94e-4287-8cc4-e2f73355657c'))}/items/@{encodeURIComponent(variables('intKlantListID'))}" }, "runAfter": {}, "type": "ApiConnection" } } }, "expression": { "and": [ { "equals": [ "@variables('intResponseCode')", 500 ] } ] }, "runAfter": {}, "type": "If" }, "Response": { "inputs": { "body": "@variables('strResponseText')", "statusCode": "@variables('intResponseCode')" }, "kind": "Http", "operationOptions": "Asynchronous", "runAfter": { "Condition": [ "Succeeded" ] }, "type": "Response" } }, "runAfter": { "Catch": [ "Succeeded", "Skipped" ] }, "type": "Scope" }, "Try": { "actions": { "CompanyName_eq_INIT": { "actions": { "getAccountCreatorProfile": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['office365users']['connectionId']" } }, "method": "get", "path": "/codeless/v1.0/users/@{encodeURIComponent(body('parseAccountCreator')?['item']?['email'])}" }, "runAfter": {}, "type": "ApiConnection" }, "messageToAccountCreator": { "inputs": { "body": { "messageBody": "<p>Hey @{body('getAccountCreatorProfile')?['givenName']},<br>\n<br>\nJe hebt een nieuw account gemaakt in Autotask waarvan jij ook de account manager bent. Op dit moment wordt de site voor deze klant gemaakt. Ik hou je op de hoogte van het maken van deze site.</p>", "recipient": "@body('getAccountCreatorProfile')?['userPrincipalName']" }, "host": { "connection": { "name": "@parameters('$connections')['teams']['connectionId']" } }, "method": "post", "path": "/beta/teams/conversation/message/poster/Flow bot/location/@{encodeURIComponent('Chat with Flow bot')}" }, "runAfter": { "getAccountCreatorProfile": [ "Succeeded" ] }, "type": "ApiConnection" } }, "description": "Geen Teams message wanneer companyname = INIT", "expression": { "and": [ { "not": { "equals": [ "@triggerBody()?['Fields']?['CompanyName']", "INIT" ] } } ] }, "runAfter": { "parseAccountCreator": [ "Succeeded" ] }, "type": "If" }, "CompanyName_eq_INIT_|_Site_created": { "actions": { "Post_message_in_a_chat_or_channel": { "inputs": { "body": { "messageBody": "<p>@{variables('strMailBody')}</p>", "recipient": "@body('getAccountCreatorProfile')?['userPrincipalName']" }, "host": { "connection": { "name": "@parameters('$connections')['teams']['connectionId']" } }, "method": "post", "path": "/beta/teams/conversation/message/poster/Flow bot/location/@{encodeURIComponent('Chat with Flow bot')}" }, "runAfter": {}, "type": "ApiConnection" } }, "expression": { "and": [ { "not": { "equals": [ "@triggerBody()?['Fields']?['CompanyName']", "INIT" ] } } ] }, "runAfter": { "set_strMailbody_|_AccountCreator": [ "Succeeded" ] }, "type": "If" }, "ITGlue_ingericht_": { "actions": { "set_strITGlueNumber": { "inputs": { "name": "strITGlueNumber", "value": "@{body('parseITGlueID')?['data'][0]['id']}" }, "runAfter": {}, "type": "SetVariable" }, "updateITGlueSiteColumn": { "inputs": { "body": { "body": "{\n\t\"__metadata\": {\n\t\t\"type\": \"SP.Data.CustomersListItem\"\n\t},\n\t\"gi_x002d_itglueLink\": {\n\t\t\"Description\": \"IT Glue\",\n\t\t\"Url\": \"https://giant-ict.eu.itglue.com/@{variables('strITGlueNumber')}\"\n\t}\n}", "headers": { "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/GetByTitle('Customers')/items(@{variables('intKlantListID')})" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/httprequest" }, "runAfter": { "set_strITGlueNumber": [ "Succeeded" ] }, "type": "ApiConnection" } }, "expression": { "and": [ { "greater": [ "@body('parseITGlueID')?['meta']?['total-pages']", 0 ] } ] }, "runAfter": { "updateAutotaksColumn": [ "Succeeded" ] }, "type": "If" }, "addTerm": { "description": "Klant managed metadata waarde toevoegen aan taxonomy", "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "casite": "https://xxxx-admin.sharepoint.com", "keyVault": "xxxx", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "sleep": 5, "termgroup": "GI", "termname": "@{trim(body('parseCompany')?['item']?['companyName'])}", "termset": "Customers" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addTerm" }, "retryPolicy": { "type": "none" } }, "runAfter": { "parseCompany": [ "Succeeded" ] }, "type": "Function" }, "applySiteDesign": { "inputs": { "body": { "body": "{\n \"siteDesignId\": \"5b977fdd-b083-40f7-ba4f-fbffc20fd6ff\"\n}", "headers": { "accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.AddSiteDesignTaskToCurrentWeb" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "delay_|_createSite_": [ "Succeeded" ] }, "type": "ApiConnection" }, "createSite": { "inputs": { "body": { "body": "{\n \"request\": {\n \"Title\": \"@{body('parseCompany')?['item']?['id']}-@{body('parseCompany')?['item']?['companyName']}\",\n \"Url\":\"@{variables('strSiteName')}\",\n \"Lcid\": 1043,\n \"ShareByEmailEnabled\":false,\n \"Description\":\"@{body('parseCompany')?['item']?['id']}-@{body('parseCompany')?['item']?['companyName']}\",\n \"WebTemplate\":\"STS#3\",\n \"Owner\":\"sa-powerplatform@giant.nl\",\n\"SiteDesignId\":\"f6cc5403-0d63-442e-96c0-285923709ffc\"\n }\n}", "headers": { "accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/SPSiteManager/create" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/'))}/httprequest" }, "runAfter": { "ITGlue_ingericht_": [ "Succeeded" ] }, "type": "ApiConnection" }, "delay_|_applySiteDesign": { "inputs": { "interval": { "count": 30, "unit": "Second" } }, "runAfter": { "applySiteDesign": [ "Succeeded" ] }, "type": "Wait" }, "delay_|_createSite_": { "inputs": { "interval": { "count": 30, "unit": "Second" } }, "runAfter": { "createSite": [ "Succeeded" ] }, "type": "Wait" }, "doBudgetsAndContractsStuff": { "actions": { "addColumnDefaultValue_|_Customer_|_Budgets_and_Contracts": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "field": "gi_x002d_customer", "folder": "", "keyVault": "xxxx", "list": "Budgets and Contracts", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "termgroup": "GI", "termset": "Customers", "type": "term", "value": "@{body('parseCompany')?['item']?['companyName']}" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addColumnDefaultValue" }, "retryPolicy": { "type": "none" } }, "runAfter": { "removeContentTypeFromList_|__Budgets_and_Contracts": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Budgetsdocument": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Budgets and Contracts", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addListOrLibrary_|_Budgets_and_Contracts": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Contractsdocument": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 0, "keyVault": "xxxx", "listname": "Budgets and Contracts", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Budgetsdocument": [ "Succeeded" ] }, "type": "Function" }, "addFolder_|_Budgets": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "documentLibrary": "Budgets and Contracts", "folderColor": "1", "folderName": "Budgets", "keyVault": "xxxx", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 60 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addFolder" } }, "runAfter": { "addView_|_Budgets_and_Contracts": [ "Succeeded" ] }, "type": "Function" }, "addFolder_|_Contracts": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "documentLibrary": "Budgets and Contracts", "folderColor": "3", "folderName": "Contracts", "keyVault": "xxxx", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 60 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addFolder" } }, "runAfter": { "addFolder_|_Budgets": [ "Succeeded" ] }, "type": "Function" }, "addListOrLibrary_|_Budgets_and_Contracts": { "description": "Document bibliiotheek maken voor Budgets and Contracts", "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "disableFolderCreation": false, "keyVault": "xxxx", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "template": "DocumentLibrary", "title": "Budgets and Contracts" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addListOrLibrary" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" }, "addView_|_Budgets_and_Contracts": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "default": true, "fieldstring": "Type|LinkFilename|Editor|Modified|gi_x002d_customer|ContentType|Keywords", "keyVault": "xxxx", "list": "Budgets and Contracts", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0, "view": "Budgets and Contract documents" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addView" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addColumnDefaultValue_|_Customer_|_Budgets_and_Contracts": [ "Succeeded" ] }, "type": "Function" }, "removeContentTypeFromList_|__Budgets_and_Contracts": { "description": "Verwijder het standaard inhoudstype 'Document'", "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypename": "Document", "keyVault": "xxxx", "listname": "Budgets and Contracts", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/removeContentTypeFromList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Contractsdocument": [ "Succeeded" ] }, "type": "Function" } }, "runAfter": { "doChangesStuff": [ "Succeeded" ] }, "type": "Scope" }, "doChangesStuff": { "actions": { "addColumnDefaultValue_|_Customer_|_Changes": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "field": "gi_x002d_customer", "folder": "", "keyVault": "xxxx", "list": "Change documents", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "termgroup": "GI", "termset": "Customers", "type": "term", "value": "@{body('parseCompany')?['item']?['companyName']}" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addColumnDefaultValue" } }, "runAfter": { "addView_|_Changes": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Changes": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Change documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addListOrLibrary_|_Changes": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Changes_folder": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Change documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_RFC_Formulier_-_ENZA": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_RFC_Formulier": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Change documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Changes": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_RFC_Formulier_-_BND": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Change documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_RFC_Formulier": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_RFC_Formulier_-_ENZA": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Change documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_RFC_Formulier_-_BND": [ "Succeeded" ] }, "type": "Function" }, "addListOrLibrary_|_Changes": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "disableFolderCreation": true, "keyVault": "xxxx", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "template": "DocumentLibrary", "title": "Change documents" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addListOrLibrary" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" }, "addView_|_Changes": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "default": true, "fieldstring": "Type|LinkFilename|Editor|Modified|gi_x002d_change|gi_x002d_changeStatus|gi-autotaskLink|gi_x002d_customer|Keywords", "keyVault": "xxxx", "list": "Change documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0, "view": "Change documents" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addView" }, "retryPolicy": { "type": "none" } }, "runAfter": { "removeContentTypeFromList_|_Changes": [ "Succeeded" ] }, "type": "Function" }, "removeContentTypeFromList_|_Changes": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypename": "Document", "keyVault": "xxxx", "listname": "Change documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/removeContentTypeFromList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Changes_folder": [ "Succeeded" ] }, "type": "Function" }, "updateColumn_|_Changes_|_gi-autotaskLink": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'AT Link'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Change documents')/Fields/getbytitle('gi-autotaskLink')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "updateColumn_|_Changes_|_gi-changeStatus": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Changes_|_gi-change": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Change'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Change documents')/Fields/getbytitle('gi-change')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "updateColumn_|_Changes_|_gi-customer": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Changes_|_gi-changeStatus": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Change status'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Change documents')/Fields/getbytitle('gi-changeStatus')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "updateColumn_|_Changes_|_gi-change": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Changes_|_gi-customer": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Customer'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Change documents')/Fields/getbytitle('gi-customer')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addColumnDefaultValue_|_Customer_|_Changes": [ "Succeeded" ] }, "type": "ApiConnection" } }, "runAfter": { "doOpportunitiesStuff": [ "Succeeded" ] }, "type": "Scope" }, "doDocumentsStuff": { "actions": { "addColumnDefaultValue_|_Customer_|_Documenten": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "field": "gi_x002d_customer", "folder": "", "keyVault": "xxxx", "list": "Documenten", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "termgroup": "GI", "termset": "Customers", "type": "term", "value": "@{body('parseCompany')?['item']?['companyName']}" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addColumnDefaultValue" }, "retryPolicy": { "type": "none" } }, "runAfter": { "removeContentTypeFromList_|_Documenten": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Documenten": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Gedeelde documenten", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "allowContentTypesOnList_|_Documenten": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Documenten_folder": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Gedeelde documenten", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Documenten": [ "Succeeded" ] }, "type": "Function" }, "addView_|_Documenten": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "default": true, "fieldstring": "Type|LinkFilename|Editor|Modified|gi_x002d_customer|Keywords", "keyVault": "xxxx", "list": "Documenten", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0, "view": "Customer documents" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addView" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addColumnDefaultValue_|_Customer_|_Documenten": [ "Succeeded" ] }, "type": "Function" }, "allowContentTypesOnList_|_Documenten": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "keyVault": "xxxx", "listname": "Gedeelde documenten", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "value": 1 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/allowContentTypesOnList" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" }, "enableFolderCreation": { "description": "enable op 0 dus disable", "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "docLib": "Documenten", "enable": 0, "keyVault": "xxxx", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/enableFolderCreation" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Documenten_folder": [ "Succeeded" ] }, "type": "Function" }, "removeContentTypeFromList_|_Documenten": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypename": "Document", "keyVault": "xxxx", "listname": "Gedeelde documenten", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/removeContentTypeFromList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "enableFolderCreation": [ "Succeeded" ] }, "type": "Function" } }, "runAfter": { "delay_|_applySiteDesign": [ "Succeeded" ] }, "type": "Scope" }, "doNavigationStuff": { "actions": { "AddAutotaskLink": { "inputs": { "body": { "body": "{\n \"__metadata\": {\n \"type\": \"SP.NavigationNode\"\n },\n \"IsExternal\": true,\n \"Title\": \"Autotask\", \n \"Url\": \"https://ww19.autotask.net/Autotask/AutotaskExtend/ExecuteCommand.aspx?Code=OpenAccount&AccountID=@{body('parseCompany')?['item']?['id']}\"\n}", "headers": { "accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "/_api/web/navigation/QuickLaunch" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": {}, "type": "ApiConnection" }, "addITGlueLink": { "inputs": { "body": { "body": "{\n \"__metadata\": {\n \"type\": \"SP.NavigationNode\"\n },\n \"IsExternal\": true,\n \"Title\": \"IT Glue\", \n \"Url\": \"https://giant-ict.eu.itglue.com/@{variables('strITGlueNumber')}\"\n}", "headers": { "accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "/_api/web/navigation/QuickLaunch" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "AddAutotaskLink": [ "Succeeded" ] }, "type": "ApiConnection" }, "addProjectenLink": { "inputs": { "body": { "body": "{\n \"__metadata\": {\n \"type\": \"SP.NavigationNode\"\n },\n \"IsExternal\": true,\n \"Title\": \"Projects\", \n \"Url\": \"https://xxxx.sharepoint.com/sites/gi-projectsportal/projects/Projects.aspx?FilterField1=gi%5Fx002d%5Fcustomer&FilterValue1=@{body('parseCompany')?['item']?['companyName']}&FilterType1=TaxonomyFieldType&viewid=5599a12e%2D3077%2D464e%2D9076%2D25adb20042c7\"\n}", "headers": { "accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "/_api/web/navigation/QuickLaunch" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addITGlueLink": [ "Succeeded" ] }, "type": "ApiConnection" }, "removeNavigationNode_|_Paginas": { "inputs": { "body": { "headers": { "accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "DELETE", "uri": "/_api/web/navigation/QuickLaunch(2003)" }, "function": "{\"id\":\"/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/removeNavigationNode\"}", "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest", "retryPolicy": { "type": "none" } }, "runAfter": { "removeNavigationNode_|_Site-inhoud": [ "Succeeded" ] }, "type": "ApiConnection" }, "removeNavigationNode_|_Site-inhoud": { "inputs": { "body": { "headers": { "accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "DELETE", "uri": "/_api/web/navigation/QuickLaunch(1034)" }, "function": "{\"id\":\"/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/removeNavigationNode\"}", "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest", "retryPolicy": { "type": "none" } }, "runAfter": { "addProjectenLink": [ "Succeeded" ] }, "type": "ApiConnection" } }, "runAfter": { "doWebpartStuff": [ "Succeeded" ] }, "type": "Scope" }, "doOpportunitiesStuff": { "actions": { "addColumnDefaultValue_|_Customer_|_Opportunities": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "field": "gi_x002d_customer", "folder": "", "keyVault": "xxxx", "list": "Opportunity documents", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "termgroup": "GI", "termset": "Customers", "type": "term", "value": "@{body('parseCompany')?['item']?['companyName']}" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addColumnDefaultValue" } }, "runAfter": { "addView_|_Opportunities": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Opportunities": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Opportunity documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addListOrLibrary_|_Opportunities": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Opportunities_folder": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Opportunity documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Opportunities": [ "Succeeded" ] }, "type": "Function" }, "addListOrLibrary_|_Opportunities": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "disableFolderCreation": true, "keyVault": "xxxx", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "template": "DocumentLibrary", "title": "Opportunity documents" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addListOrLibrary" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" }, "addView_|_Opportunities": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "default": true, "fieldstring": "Type|LinkFilename|Editor|Modified|gi_x002d_opportunity|gi_x002d_opportunityStatus|gi-autotaskLink|gi_x002d_customer|Keywords", "keyVault": "xxxx", "list": "Opportunity documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0, "view": "Opportunity documents" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addView" }, "retryPolicy": { "type": "none" } }, "runAfter": { "removeContentTypeFromList_|_Opportunities": [ "Succeeded" ] }, "type": "Function" }, "removeContentTypeFromList_|_Opportunities": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypename": "Document", "keyVault": "xxxx", "listname": "Opportunity documents", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/removeContentTypeFromList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Opportunities_folder": [ "Succeeded" ] }, "type": "Function" }, "updateColumn_|_Opportunities_|_gi-autotaskLink": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'AT Link'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Opportunity documents')/Fields/getbytitle('gi-autotaskLink')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "updateColumn_|_Opportunities_|_gi-opportunityStatus": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Opportunities_|_gi-customer": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Customer'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Opportunity documents')/Fields/getbytitle('gi-customer')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addColumnDefaultValue_|_Customer_|_Opportunities": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Opportunities_|_gi-opportunity": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Opportunity'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Opportunity documents')/Fields/getbytitle('gi-opportunity')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "updateColumn_|_Opportunities_|_gi-customer": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Opportunities_|_gi-opportunityStatus": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Opportunity status'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Opportunity documents')/Fields/getbytitle('gi-opportunityStatus')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "updateColumn_|_Opportunities_|_gi-opportunity": [ "Succeeded" ] }, "type": "ApiConnection" } }, "runAfter": { "doDocumentsStuff": [ "Succeeded" ] }, "type": "Scope" }, "doPermissionStuff": { "actions": { "addAdministratieToBudgetsContractsGroup": { "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|92c64d91-f66b-4dab-b1c3-00f9fd815377\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createBudgetsContractsGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addSalesToBudgetsContractsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addBackofficeToContributorsGroup": { "description": "AAD Groep GI - Backoffice toevoegen aan groep met bijdraag rechten", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|f733f045-4f46-4da3-8c90-6a01f179bbe9\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createContributorsGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addManagementToContributorsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addGIAlgemeenToChangeContributorsGroup": { "description": "GI Algemeen Team toevoegen aan gemaakte SharePoint", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|86c8f4d7-09ee-4f4c-83f4-f6577fec39c4\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createChangeContributorsGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "createChangeContributorsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addManagementToBudgetsContractsGroup": { "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|2ad0a485-11ad-4a6f-8400-bdcd354d7829\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createBudgetsContractsGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addAdministratieToBudgetsContractsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addManagementToContributorsGroup": { "description": "AAD Groep GI - Management toevoegen aan groep met bijdraag rechten", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|2ad0a485-11ad-4a6f-8400-bdcd354d7829\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createContributorsGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addSalesToContributorsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addManagementToServicemanagementGroup": { "description": "AAD Group GI - Management toevoegen aan gemaakte SharePoint Groep", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|2ad0a485-11ad-4a6f-8400-bdcd354d7829\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createServicemanagementGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addSalesToServicemanagementGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addSalesToBudgetsContractsGroup": { "description": "AAD Group GI - Verkoop toevoegen aan gemaakte SharePoint Groep", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|49ebc036-8035-4db6-80f3-111af3fd2b59\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createBudgetsContractsGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "createBudgetsContractsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addSalesToContributorsGroup": { "description": "AAD Groep GI - Verkoop toevoegen aan groep met bijdraag rechten", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|49ebc036-8035-4db6-80f3-111af3fd2b59\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createContributorsGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "createContributorsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addSalesToServicemanagementGroup": { "description": "AAD Group GI - Sales toevoegen aan gemaakte SharePoint Groep", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|49ebc036-8035-4db6-80f3-111af3fd2b59\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createServicemanagementGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addServicemanagementToServicemanagementGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addServiceManagementToBudgetsContractsGroup": { "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|1d6f7b6f-bd2a-4b50-87df-7482857dfd3c\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createBudgetsContractsGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addManagementToBudgetsContractsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "addServicemanagementToServicemanagementGroup": { "description": "AAD Group GI - Service Management toevoegen aan gemaakte SharePoint Groep", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.User\"\n},\n\"LoginName\":\"c:0o.c|federateddirectoryclaimprovider|1d6f7b6f-bd2a-4b50-87df-7482857dfd3c\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/sitegroups(@{body('createServicemanagementGroup')?['d']?['Id']})/users" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "createServicemanagementGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "breakRoleinheritanceBudgetsContracts": { "inputs": { "body": { "headers": { "Accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/lists/getByTitle('Budgets and Contracts')/breakroleinheritance(copyRoleAssignments=false, clearSubscopes=true)" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addServiceManagementToBudgetsContractsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "breakRoleinheritanceChanges": { "description": "Overerving van rechten op changes documentenbigliotheek verbreken, bestaande rechten behouden", "inputs": { "body": { "headers": { "Accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/lists/getByTitle('Change documents')/breakroleinheritance(copyRoleAssignments=true, clearSubscopes=true)" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addGIAlgemeenToChangeContributorsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "breakRoleinheritanceServicemanagement": { "inputs": { "body": { "headers": { "Accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/lists/getByTitle('Servicemanagement')/breakroleinheritance(copyRoleAssignments=false, clearSubscopes=true)" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addManagementToServicemanagementGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "createBudgetsContractsGroup": { "description": "SharePoint groep maken voor document bibliotheek Budgets and Contracts", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.Group\"\n},\n\"Title\": \"@{body('la-removeOnwantedCharacters')} - Budgets Contracts Bijdragers\",\n\"Description\": \"Leden met bijdraag rechten op de documentenbibliotheek Budgets and Contracts\"\n}", "headers": { "accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/SiteGroups" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "grantServicemanagementGroupContributorRights": [ "Succeeded" ] }, "type": "ApiConnection" }, "createChangeContributorsGroup": { "description": "SharePoint groep maken voor bewerkrechten op changes document library", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.Group\"\n},\n\"Title\": \"@{body('la-removeOnwantedCharacters')} - Change Bijdragers\",\n\"Description\": \"Leden met bijdraag rechten op change documents bibliotheek\"\n}", "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/SiteGroups" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "grantContributorsGroupContributorRights": [ "Succeeded" ] }, "type": "ApiConnection" }, "createContributorsGroup": { "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.Group\"\n},\n\"Title\": \"@{body('la-removeOnwantedCharacters')} - Bijdragers\",\n\"Description\": \"Leden met bijdraag rechten\"\n}", "headers": { "accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/SiteGroups" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "grantBudgetsContractsGroupContributorRights": [ "Succeeded" ] }, "type": "ApiConnection" }, "createServicemanagementGroup": { "description": "SharePoint groep maken voor document bibliotheek Servicemanagement", "inputs": { "body": { "body": "{\n\"__metadata\": {\n\"type\":\"SP.Group\"\n},\n\"Title\": \"@{body('la-removeOnwantedCharacters')} - Servicemanagement Bijdragers\",\n\"Description\": \"Leden met bijdraag rechten op de documentenbibliotheek Servicemanagement\"\n}", "headers": { "accept": "application/json;odata=verbose", "content-Type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/SiteGroups" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "la-removeOnwantedCharacters": [ "Succeeded" ] }, "type": "ApiConnection" }, "grantBudgetsContractsGroupContributorRights": { "inputs": { "body": { "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/lists/getByTitle('Budgets and Contracts')/roleassignments/addroleassignment(principalid=@{body('createBudgetsContractsGroup')?['d']?['Id']},roleDefId=1073741827)" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "breakRoleinheritanceBudgetsContracts": [ "Succeeded" ] }, "type": "ApiConnection" }, "grantChangeContributorsGroupContributorRights": { "description": "Gemaakte groep bijdraagrechten geven over documentenbibliotheek", "inputs": { "body": { "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/lists/getByTitle('Change documents')/roleassignments/addroleassignment(principalid=@{body('createChangeContributorsGroup')?['d']?['Id']},roleDefId=1073741827)" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "breakRoleinheritanceChanges": [ "Succeeded" ] }, "type": "ApiConnection" }, "grantContributorsGroupContributorRights": { "inputs": { "body": { "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/roleassignments/addroleassignment(principalid=@{body('createContributorsGroup')?['d']?['Id']},roledefid=1073741827)" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "addBackofficeToContributorsGroup": [ "Succeeded" ] }, "type": "ApiConnection" }, "grantServicemanagementGroupContributorRights": { "inputs": { "body": { "headers": { "accept ": "application/json;odata=verbose", "content-type": "application/json;odata=verbose" }, "method": "POST", "uri": "_api/web/lists/getByTitle('Servicemanagement')/roleassignments/addroleassignment(principalid=@{body('createServicemanagementGroup')?['d']?['Id']},roleDefId=1073741827)" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "breakRoleinheritanceServicemanagement": [ "Succeeded" ] }, "type": "ApiConnection" }, "la-removeOnwantedCharacters": { "description": "Naam van SharePoint groep mag bepaalde karakters niet bevatten.", "inputs": { "body": { "strToModify": "{\"@{body('parseCompany')?['item']?['id']}-@{body('parseCompany')?['item']?['companyName']}\"}" }, "host": { "triggerName": "manual", "workflow": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/customer-automation-rg/providers/Microsoft.Logic/workflows/la-removeOnwantedCharacters" } } }, "runAfter": {}, "type": "Workflow" } }, "runAfter": { "doNavigationStuff": [ "Succeeded" ] }, "type": "Scope" }, "doServicemanagementStuff": { "actions": { "addColumnDefaultValue_|_Customer_|_Servicemanagement": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "field": "gi_x002d_customer", "folder": "", "keyVault": "xxxx", "list": "Servicemanagement", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "termgroup": "GI", "termset": "Customers", "type": "term", "value": "@{body('parseCompany')?['item']?['companyName']}" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addColumnDefaultValue" }, "retryPolicy": { "type": "none" } }, "runAfter": { "removeContentTypeFromList_|_Servicemanagement": [ "Succeeded" ] }, "type": "Function" }, "addContentTypeToList_|_Servicemanagement": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypeid": "xxxx", "default": 1, "keyVault": "xxxx", "listname": "Servicemanagement", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addContentTypeToList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addListOrLibrary_|_Servicemanagement": [ "Succeeded" ] }, "type": "Function" }, "addListOrLibrary_|_Servicemanagement": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "disableFolderCreation": false, "keyVault": "xxxx", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10, "template": "DocumentLibrary", "title": "Servicemanagement" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addListOrLibrary" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" }, "addView_|_Servicemanagement": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "default": true, "fieldstring": "Type|LinkFilename|Editor|Modified|gi_x002d_customer|Keywords", "keyVault": "xxxx", "list": "Servicemanagement", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0, "view": "Servicemanagement documents" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addView" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addColumnDefaultValue_|_Customer_|_Servicemanagement": [ "Succeeded" ] }, "type": "Function" }, "removeContentTypeFromList_|_Servicemanagement": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "contenttypename": "Document", "keyVault": "xxxx", "listname": "Servicemanagement", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 0 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/removeContentTypeFromList" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addContentTypeToList_|_Servicemanagement": [ "Succeeded" ] }, "type": "Function" } }, "runAfter": { "doBudgetsAndContractsStuff": [ "Succeeded" ] }, "type": "Scope" }, "doWebpartStuff": { "actions": { "addFirstSectionToPage": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "keyVault": "xxxx", "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "PnPThumbprint", "sectionOrderIdx": 1, "sectionTemplate": "TwoColumnLeft", "site": "@{variables('strSiteName')}", "sleep": 10, "zoneEmphasis": 0 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addSectionToPage" }, "retryPolicy": { "type": "none" } }, "runAfter": { "setHomepage": [ "Succeeded" ] }, "type": "Function" }, "addWebPart_|_SiteActivity": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "column": 1, "keyVault": "xxxx", "order": 0, "pageName": "home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "section": 1, "site": "@{variables('strSiteName')}", "sleep": 10, "webpartType": "SiteActivity" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addWebPart" }, "retryPolicy": { "type": "none" } }, "runAfter": { "addFirstSectionToPage": [ "Succeeded" ] }, "type": "Function" }, "bnAddPeoplePart_eq_true": { "actions": { "addPeoplePart_|_Accountmanager": { "description": "Accountmanager toevoegen", "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "cardName": "Account team", "column": 2, "keyVault": "xxxx", "pageName": "Home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "section": 1, "site": "@{variables('strSiteName')}", "sleep": 0, "users": "[{'mail':'@{body('parseAccountManager')?['item']?['email']}', 'role':'' }]" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addPeoplePart" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" } }, "description": "Indien er voor de customer een accountmanager is ingesteld", "else": { "actions": { "addPeoplePart": { "description": "Accountcreator toevoegen", "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "cardName": "Account team", "column": 2, "keyVault": "xxxx", "pageName": "Home", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "section": 1, "site": "@{variables('strSiteName')}", "sleep": 0, "users": "[{'mail':'@{body('parseAccountCreator')?['item']?['email']}', 'role':'' }]" }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/addPeoplePart" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" } } }, "expression": { "and": [ { "equals": [ "@variables('bnAddPeoplePart')", "@true" ] } ] }, "runAfter": { "addWebPart_|_SiteActivity": [ "Succeeded" ] }, "type": "If" }, "setHomepage": { "inputs": { "body": { "adminsite": "https://xxxx.sharepoint.com/sites/gi-site-provisioning", "docLib": "SitePages", "keyVault": "xxxx", "pageName": "home.aspx", "pnpApplicationIDKey": "PnPApplicationID", "pnpThumbprintKey": "pnpThumbprint", "site": "@{variables('strSiteName')}", "sleep": 10 }, "function": { "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-rg/providers/Microsoft.Web/sites/fa-siteprovisioning-ps/functions/setHomepage" }, "retryPolicy": { "type": "none" } }, "runAfter": {}, "type": "Function" } }, "runAfter": { "doServicemanagementStuff": [ "Succeeded" ] }, "type": "Scope" }, "getAccountCreator": { "inputs": { "headers": { "ApiIntegrationCode": "@body('get-atApiIntegrationCode')?['value']", "Cache-Control": "no-cache", "Content-Type": "application/json", "Secret": "@body('get-atSecret')?['value']", "UserName": "@body('get-atUsername')?['value']" }, "method": "GET", "uri": "https://webservices19.autotask.net/atservicesrest/v1.0/Resources/@{body('parseCompany')?['item']?['createdByResourceID']}" }, "runAfter": { "set_strSiteName": [ "Succeeded" ] }, "type": "Http" }, "getAccountManager": { "inputs": { "headers": { "ApiIntegrationCode": "@body('get-atApiIntegrationCode')?['value']", "Cache-Control": "no-cache", "Content-Type": "application/json", "Secret": "@body('get-atSecret')?['value']", "UserName": "@body('get-atUsername')?['value']" }, "method": "GET", "uri": "https://webservices19.autotask.net/atservicesrest/v1.0/Resources/@{body('parseCompany')?['item']?['ownerResourceID']}" }, "runAfter": { "CompanyName_eq_INIT": [ "Succeeded" ] }, "type": "Http" }, "getAccountTeam": { "inputs": { "headers": { "ApiIntegrationCode": "@body('get-atApiIntegrationCode')?['value']", "Cache-Control": "no-cache", "Content-Type": "application/json", "Secret": "@body('get-atSecret')?['value']", "UserName": "@body('get-atUsername')?['value']" }, "method": "GET", "queries": { "search": "{\"filter\":[{\"op\":\"eq\",\"field\":\"CompanyID\",\"value\":@{body('parseCompany')?['item']?['id']}}]}" }, "uri": "https://webservices19.autotask.net/atservicesrest/v1.0/CompanyTeams/query" }, "runAfter": { "parseAccountManager": [ "Succeeded" ] }, "type": "Http" }, "getCompany": { "inputs": { "headers": { "ApiIntegrationCode": "@body('get-atApiIntegrationCode')?['value']", "Cache-Control": "no-cache", "Content-Type": "application/json", "Secret": "@body('get-atSecret')?['value']", "UserName": "@body('get-atUsername')?['value']" }, "method": "GET", "uri": "https://webservices19.autotask.net/atservicesrest/v1.0/Companies/@{triggerBody()?['Id']}" }, "runAfter": { "getSecrets": [ "Succeeded" ] }, "type": "Http" }, "getITGlueID": { "description": "IT Glue ID van company ophalen voor directe link vanaf site naar IT Glue gegevens van klant", "inputs": { "headers": { "Content-Type": "application/vnd.api+json", "x-api-key": "@body('get-itgAPIKey')?['value']" }, "method": "GET", "queries": { "filter[name]": "@body('parseCompany')?['item']?['companyName']" }, "uri": "https://api.eu.itglue.com/organizations" }, "runAfter": { "getAccountTeam": [ "Succeeded" ] }, "type": "Http" }, "getSecrets": { "actions": { "get-GraphApplicationID": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['keyvault']['connectionId']" } }, "method": "get", "path": "/secrets/@{encodeURIComponent('kg-GraphApplicatonID')}/value" }, "runAfter": { "get-atUsername": [ "Succeeded" ] }, "type": "ApiConnection" }, "get-GraphSecret": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['keyvault']['connectionId']" } }, "method": "get", "path": "/secrets/@{encodeURIComponent('kg-GraphSecret')}/value" }, "runAfter": { "get-GraphApplicationID": [ "Succeeded" ] }, "type": "ApiConnection" }, "get-GraphTenantID": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['keyvault']['connectionId']" } }, "method": "get", "path": "/secrets/@{encodeURIComponent('kg-GraphTenantID')}/value" }, "runAfter": { "get-GraphSecret": [ "Succeeded" ] }, "type": "ApiConnection" }, "get-atApiIntegrationCode": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['keyvault']['connectionId']" } }, "method": "get", "path": "/secrets/@{encodeURIComponent('at-ApiIntegrationCode')}/value" }, "runAfter": {}, "type": "ApiConnection" }, "get-atSecret": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['keyvault']['connectionId']" } }, "method": "get", "path": "/secrets/@{encodeURIComponent('at-Secret')}/value" }, "runAfter": { "get-atApiIntegrationCode": [ "Succeeded" ] }, "type": "ApiConnection" }, "get-atUsername": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['keyvault']['connectionId']" } }, "method": "get", "path": "/secrets/@{encodeURIComponent('at-UserName')}/value" }, "runAfter": { "get-atSecret": [ "Succeeded" ] }, "type": "ApiConnection" }, "get-itgAPIKey": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['keyvault']['connectionId']" } }, "method": "get", "path": "/secrets/@{encodeURIComponent('itg-APIKey')}/value" }, "runAfter": { "get-GraphTenantID": [ "Succeeded" ] }, "type": "ApiConnection" } }, "runAfter": {}, "type": "Scope" }, "parseAccountCreator": { "inputs": { "content": "@body('getAccountCreator')", "schema": { "properties": { "item": { "properties": { "email": { "type": "string" } }, "type": "object" } }, "type": "object" } }, "runAfter": { "getAccountCreator": [ "Succeeded" ] }, "type": "ParseJson" }, "parseAccountManager": { "inputs": { "content": "@body('getAccountManager')", "schema": { "properties": { "item": { "properties": { "email": { "type": "string" }, "isActive": { "type": "boolean" }, "userName": { "type": "string" } }, "type": "object" } }, "type": "object" } }, "runAfter": { "getAccountManager": [ "Succeeded" ] }, "type": "ParseJson" }, "parseCompany": { "inputs": { "content": "@body('getCompany')", "schema": { "properties": { "item": { "properties": { "companyName": { "type": "string" }, "companyNumber": { "type": "string" }, "companyType": { "type": "integer" }, "createdByResourceID": { "type": "integer" }, "id": { "type": "integer" }, "isActive": { "type": "boolean" }, "lastActivityDate": { "type": "string" }, "ownerResourceID": { "type": "integer" } }, "type": "object" } }, "type": "object" } }, "runAfter": { "getCompany": [ "Succeeded" ] }, "type": "ParseJson" }, "parseITGlueID": { "inputs": { "content": "@body('getITGlueID')", "schema": { "properties": { "data": { "items": { "properties": { "id": { "type": "string" }, "type": { "type": "string" } }, "required": [ "id", "type" ], "type": "object" }, "type": "array" }, "meta": { "properties": { "current-page": { "type": "integer" }, "next-page": {}, "prev-page": {}, "total-count": { "type": "integer" }, "total-pages": { "type": "integer" } }, "type": "object" } }, "type": "object" } }, "runAfter": { "getITGlueID": [ "Succeeded" ] }, "type": "ParseJson" }, "set_strMailbody_|_AccountCreator": { "inputs": { "name": "strMailBody", "value": "<p>Hey @{body('getAccountCreatorProfile')?['givenName']},</p>\n<p>De site voor klant: @{body('parseCompany')?['item']?['companyName']} is gereed. <a href=\"@{variables('strSiteName')}\">Hier</a> vind je de site.</p>\n<p>Succes met deze klant</p>" }, "runAfter": { "updateColumn_|_Documenten_|_gi-customer": [ "Succeeded" ] }, "type": "SetVariable" }, "set_strSiteName": { "inputs": { "name": "strSiteName", "value": "https://xxxx.sharepoint.com/sites/@{body('parseCompany')?['item']?['id']}" }, "runAfter": { "addTerm": [ "Succeeded" ] }, "type": "SetVariable" }, "switchAccountmanger": { "cases": { "Geen_Accountmanager_aanwezig": { "actions": { "createKlantItem_|_no_accountmanager": { "inputs": { "body": { "Title": "@{first(body('parseCompany')?['item']?['companyName'])}", "gi_x002d_customerId": "@body('parseCompany')?['item']?['id']", "gi_x002d_customerNumber": "@body('parseCompany')?['item']?['companyNumber']", "gi_x002d_customeractive": "@body('parseCompany')?['item']?['isActive']", "gi_x002d_modifieddatetime": "@{body('parseCompany')?['item']?['lastActivityDate']}" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/tables/@{encodeURIComponent(encodeURIComponent('06604a18-d94e-4287-8cc4-e2f73355657c'))}/items" }, "runAfter": {}, "type": "ApiConnection" }, "set_intKlantListID_|_no_accountmanager": { "inputs": { "name": "intKlantListID", "value": "@body('createKlantItem_|_no_accountmanager')?['ID']" }, "runAfter": { "createKlantItem_|_no_accountmanager": [ "Succeeded" ] }, "type": "SetVariable" } }, "case": 0 } }, "default": { "actions": { "Accountmanager_present_and_active": { "actions": { "searchForAccountManager": { "inputs": { "host": { "connection": { "name": "@parameters('$connections')['office365users']['connectionId']" } }, "method": "get", "path": "/v2/users", "queries": { "isSearchTermRequired": true, "searchTerm": "@body('parseAccountManager')?['item']?['email']" } }, "runAfter": {}, "type": "ApiConnection" }, "searchForAccountManager_gt_0": { "actions": { "createKlantItem_|_accountmanager_present": { "inputs": { "body": { "Title": "@{first(body('parseCompany')?['item']?['companyName'])}", "gi_x002d_accountManager": { "Claims": "@body('parseAccountManager')?['item']?['email']" }, "gi_x002d_customerId": "@body('parseCompany')?['item']?['id']", "gi_x002d_customerNumber": "@body('parseCompany')?['item']?['companyNumber']", "gi_x002d_customeractive": "@body('parseCompany')?['item']?['isActive']", "gi_x002d_modifieddatetime": "@{body('parseCompany')?['item']?['lastActivityDate']}" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/tables/@{encodeURIComponent(encodeURIComponent('06604a18-d94e-4287-8cc4-e2f73355657c'))}/items" }, "runAfter": {}, "type": "ApiConnection" }, "set_bnAddPeoplePart": { "inputs": { "name": "bnAddPeoplePart", "value": "@true" }, "runAfter": { "createKlantItem_|_accountmanager_present": [ "Succeeded" ] }, "type": "SetVariable" }, "set_intKlantListID_|_accountmanager_present": { "inputs": { "name": "intKlantListID", "value": "@body('createKlantItem_|_accountmanager_present')?['ID']" }, "runAfter": { "set_bnAddPeoplePart": [ "Succeeded" ] }, "type": "SetVariable" } }, "else": { "actions": { "createKlantItem_|_no_accountmanager_in_AAD": { "inputs": { "body": { "Title": "@{first(body('parseCompany')?['item']?['companyName'])}", "gi_x002d_customerId": "@body('parseCompany')?['item']?['id']", "gi_x002d_customerNumber": "@body('parseCompany')?['item']?['companyNumber']", "gi_x002d_customeractive": "@body('parseCompany')?['item']?['isActive']", "gi_x002d_modifieddatetime": "@{body('parseCompany')?['item']?['lastActivityDate']}" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/tables/@{encodeURIComponent(encodeURIComponent('06604a18-d94e-4287-8cc4-e2f73355657c'))}/items" }, "runAfter": {}, "type": "ApiConnection" }, "set_intKlantListID_|_no_accountmanager_in_AAD": { "inputs": { "name": "intKlantListID", "value": "@body('createKlantItem_|_no_accountmanager_in_AAD')?['ID']" }, "runAfter": { "createKlantItem_|_no_accountmanager_in_AAD": [ "Succeeded" ] }, "type": "SetVariable" } } }, "expression": { "and": [ { "greater": [ "@outputs('searchForAccountManager_|_length')", 0 ] } ] }, "runAfter": { "searchForAccountManager_|_length": [ "Succeeded" ] }, "type": "If" }, "searchForAccountManager_|_length": { "inputs": "@length(body('searchForAccountManager')?['value'])", "runAfter": { "searchForAccountManager": [ "Succeeded" ] }, "type": "Compose" } }, "else": { "actions": { "createKlantItem_|_accountmanager_inactive": { "inputs": { "body": { "Title": "@{first(body('parseCompany')?['item']?['companyName'])}", "gi_x002d_customerId": "@body('parseCompany')?['item']?['id']", "gi_x002d_customerNumber": "@body('parseCompany')?['item']?['companyNumber']", "gi_x002d_customeractive": "@body('parseCompany')?['item']?['isActive']", "gi_x002d_modifieddatetime": "@{body('parseCompany')?['item']?['lastActivityDate']}" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/tables/@{encodeURIComponent(encodeURIComponent('06604a18-d94e-4287-8cc4-e2f73355657c'))}/items" }, "runAfter": {}, "type": "ApiConnection" }, "set_intKlantListID_|_accountmanager_inactive": { "inputs": { "name": "intKlantListID", "value": "@body('createKlantItem_|_accountmanager_inactive')?['ID']" }, "runAfter": { "createKlantItem_|_accountmanager_inactive": [ "Succeeded" ] }, "type": "SetVariable" } } }, "expression": { "and": [ { "equals": [ "@body('parseAccountManager')?['item']?['isActive']", true ] } ] }, "runAfter": {}, "type": "If" } } }, "expression": "@length(body('parseAccountManager')?['item']?['email'])", "runAfter": { "parseITGlueID": [ "Succeeded" ] }, "type": "Switch" }, "updateAutotaksColumn": { "inputs": { "body": { "body": "{\n\t\"__metadata\": {\n\t\t\"type\": \"SP.Data.CustomersListItem\"\n\t},\n\t\"gi_x002d_autotaskLink\": {\n\t\t\"Description\": \"Autotask\",\n\t\t\"Url\": \"https://ww19.autotask.net/Autotask/AutotaskExtend/ExecuteCommand.aspx?Code=OpenAccount&AccountID=@{body('parseCompany')?['item']?['id']}\"\n\t}\n}", "headers": { "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/GetByTitle('Customers')/items(@{variables('intKlantListID')})" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/httprequest" }, "runAfter": { "updateKlantsiteColumn": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Budgets_and_Contracts_|_gi-customer": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Customer'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Budgets and Contracts')/Fields/getbytitle('gi-customer')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "updateColumn_|_Servicemanagement_|_gi-customer": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Documenten_|_gi-customer": { "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Customer'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Documenten')/Fields/getbytitle('gi-customer')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "updateColumn_|_Budgets_and_Contracts_|_gi-customer": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateColumn_|_Servicemanagement_|_gi-customer": { "description": "Om de een of andere reden moet dit later", "inputs": { "body": { "body": "{\n '__metadata': {\n 'type': 'SP.List'\n },\n 'Title': 'Customer'\n}", "headers": { "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/getbytitle('Servicemanagement')/Fields/getbytitle('gi-customer')" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent(variables('strSiteName')))}/httprequest" }, "runAfter": { "doPermissionStuff": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateKlantColumn": { "inputs": { "body": { "body": "{\n \"formValues\":[\n\t{\n\t \"FieldName\": \"gi_x002d_customer\",\n\t \"FieldValue\": \"@{body('addTerm')}\"\n\t}\n ]\n}", "method": "POST", "uri": "_api/web/lists/GetByTitle('Customers')/items(@{variables('intKlantListID')})/validateUpdateListItem" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/httprequest" }, "runAfter": { "switchAccountmanger": [ "Succeeded" ] }, "type": "ApiConnection" }, "updateKlantsiteColumn": { "inputs": { "body": { "body": "{\n\t\"__metadata\": {\n\t\t\"type\": \"SP.Data.CustomersListItem\"\n\t},\n\t\"gi_x002d_customerSite\": {\n\t\t\"Description\": \"@{body('parseCompany')?['item']?['companyName']}\",\n\t\t\"Url\": \"@{variables('strSiteName')}\"\n\t}\n}", "headers": { "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*", "X-HTTP-Method": "MERGE" }, "method": "POST", "uri": "_api/web/lists/GetByTitle('Customers')/items(@{variables('intKlantListID')})" }, "host": { "connection": { "name": "@parameters('$connections')['sharepointonline']['connectionId']" } }, "method": "post", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('https://xxxx.sharepoint.com/sites/portal'))}/httprequest" }, "runAfter": { "updateKlantColumn": [ "Succeeded" ] }, "type": "ApiConnection" } }, "runAfter": { "init_bnAddPeoplePart": [ "Succeeded" ] }, "type": "Scope" }, "init_bnAddPeoplePart": { "inputs": { "variables": [ { "name": "bnAddPeoplePart", "type": "boolean", "value": "@false" } ] }, "runAfter": { "init_strITGlueNumber": [ "Succeeded" ] }, "type": "InitializeVariable" }, "init_intKlantListID": { "inputs": { "variables": [ { "name": "intKlantListID", "type": "integer" } ] }, "runAfter": {}, "type": "InitializeVariable" }, "init_intResponseCode": { "inputs": { "variables": [ { "name": "intResponseCode", "type": "integer", "value": 200 } ] }, "runAfter": { "init_strSiteName": [ "Succeeded" ] }, "type": "InitializeVariable" }, "init_strITGlueNumber": { "inputs": { "variables": [ { "name": "strITGlueNumber", "type": "string" } ] }, "runAfter": { "init_strMailBody": [ "Succeeded" ] }, "type": "InitializeVariable" }, "init_strMailBody": { "inputs": { "variables": [ { "name": "strMailBody", "type": "string" } ] }, "runAfter": { "init_strResponseText": [ "Succeeded" ] }, "type": "InitializeVariable" }, "init_strResponseText": { "inputs": { "variables": [ { "name": "strResponseText", "type": "string", "value": "Company created" } ] }, "runAfter": { "init_intResponseCode": [ "Succeeded" ] }, "type": "InitializeVariable" }, "init_strSiteName": { "inputs": { "variables": [ { "name": "strSiteName", "type": "string" } ] }, "runAfter": { "init_intKlantListID": [ "Succeeded" ] }, "type": "InitializeVariable" } }, "contentVersion": "1.0.0.0", "outputs": {}, "parameters": { "$connections": { "defaultValue": {}, "type": "Object" } }, "triggers": { "manual": { "inputs": { "schema": { "properties": { "Action": { "type": "string" }, "EntityType": { "type": "string" }, "EventTime": { "type": "string" }, "Fields": { "properties": { "CompanyName": { "type": "string" } }, "type": "object" }, "Guid": { "type": "string" }, "Id": { "type": "integer" }, "PersonId": { "type": "integer" }, "SequenceNumber": { "type": "integer" } }, "type": "object" } }, "kind": "Http", "runtimeConfiguration": { "concurrency": { "runs": 1 } }, "type": "Request" } } }, "parameters": { "$connections": { "value": { "keyvault": { "connectionId": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-kg-rg/providers/Microsoft.Web/connections/keyvault-1", "connectionName": "keyvault-1", "connectionProperties": { "authentication": { "type": "ManagedServiceIdentity" } }, "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/providers/Microsoft.Web/locations/westeurope/managedApis/keyvault" }, "office365users": { "connectionId": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-kg-rg/providers/Microsoft.Web/connections/office365users", "connectionName": "office365users", "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/providers/Microsoft.Web/locations/westeurope/managedApis/office365users" }, "sharepointonline": { "connectionId": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-kg-rg/providers/Microsoft.Web/connections/sharepointonline", "connectionName": "sharepointonline", "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/providers/Microsoft.Web/locations/westeurope/managedApis/sharepointonline" }, "teams": { "connectionId": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/resourceGroups/site-provisioning-kg-rg/providers/Microsoft.Web/connections/teams", "connectionName": "teams", "id": "/subscriptions/11111q1z-76b3-45ba-a4c1-c7d3b4a53e13/providers/Microsoft.Web/locations/westeurope/managedApis/teams" } } } } }

stefanstranger commented 1 year ago

Hi @acieslik,

Sorry for not responding earlier. I was a bit busy and on holiday. Hope to find some time next weeks.

/Stefan

stefanstranger commented 8 months ago

Hi @acieslik , after my initial investigation it might be caused by the the async_response action which is nowhere configured as a runafter property of one of the other actions.

To determine the order of the actions I try to use the runafter property. Any thoughts on how to determine the order of the actions when an async_response is being used?

stefanstranger commented 8 months ago

Hi @acieslik,

This is the result I've now when doing some refactoring. Can you confirm this is a correct representation of the flow?

https://gist.github.com/stefanstranger/9681324a42b297a6749cd1505e62af94

stefanstranger commented 8 months ago

HI @hsncrook,

I've made some changes to the code and I've now the following result:

https://gist.github.com/stefanstranger/bd69c9e7d8a3486205f4567949ef52a2

Can you please validate if this is correct now?

Regards, Stefan