CSV 2 JSON、略して C2J かどうかは知らないが、
ARM
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"BLOB_コンテンツを取得する_(V2)": {
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob_1']['connectionId']"
}
},
"method": "get",
"path": "/v2/datasets/@{encodeURIComponent(encodeURIComponent('https://noystorageaccount.blob.core.windows.net/'))}/files/@{encodeURIComponent(encodeURIComponent('JTJmZm9sZGVyJTJmdW1pbm9jb21wYW55LmNzdg=='))}/content",
"queries": {
"inferContentType": true
}
},
"metadata": {
"JTJmZm9sZGVyJTJmdW1pbm9jb21wYW55LmNzdg==": "/folder/uminocompany.csv"
},
"runAfter": {},
"type": "ApiConnection"
},
"For_each": {
"actions": {
"SplitByComma": {
"inputs": "@split(item(), ',')",
"runAfter": {},
"type": "Compose"
},
"作成": {
"inputs": {
"メールアドレス": "@{outputs('SplitByComma')?[3]}",
"社員名称": "@{outputs('SplitByComma')?[1]}",
"社員番号": "@{outputs('SplitByComma')?[0]}",
"電話番号": "@{outputs('SplitByComma')?[2]}"
},
"runAfter": {
"SplitByComma": [
"Succeeded"
]
},
"type": "Compose"
}
},
"foreach": "@skip(outputs('SplitbyLine'),1)",
"runAfter": {
"SplitbyLine": [
"Succeeded"
]
},
"type": "Foreach"
},
"SplitbyLine": {
"inputs": "@split(body('BLOB_コンテンツを取得する_(V2)'), decodeUriComponent('%0D%0A'))",
"runAfter": {
"BLOB_コンテンツを取得する_(V2)": [
"Succeeded"
]
},
"type": "Compose"
},
"json": {
"inputs": "@outputs('作成')",
"runAfter": {
"For_each": [
"Succeeded"
]
},
"type": "Compose"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {
"$connections": {
"value": {
"azureblob_1": {
"connectionId": "/subscriptions/<SubscriptionID>/resourceGroups/<ResourceGroup>/providers/Microsoft.Web/connections/azureblob",
"connectionName": "azureblob",
"connectionProperties": {
"authentication": {
"type": "ManagedServiceIdentity"
}
},
"id": "/subscriptions/<SubscriptionID>/providers/Microsoft.Web/locations/japaneast/managedApis/azureblob"
}
}
}
}
}
つづく
前職では外部連携と言えば CSV 出力、CSV 取込 ばかりだったのですが、JSON 楽しいですね。
こんな記事もあります。つづく。