我们有一个SharePoint Online站点,用户可以在其中添加/删除项目到文档库。但是,我们要添加一个步骤,以便在实际删除项目之前批准删除操作(不想从回收站中还原项目)。这可能吗?
不幸的是,只有当文件/项目已被删除时才会删除它。您可以在项目被删除,请求批准时触发Flow,如果它被拒绝,则使用REST API从回收站中查找和恢复该项目。
在回收站中找到正确的项目有点棘手,但可以实现。
屏幕截图中的first(...)
是:first(body('Parse_JSON')?['value'])?['Id']
Parse JSON操作中的模式:
{
"type": "object",
"properties": {
"odata.metadata": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"odata.type": {
"type": "string"
},
"odata.id": {
"type": "string"
},
"odata.editLink": {
"type": "string"
},
"AuthorEmail": {
"type": "string"
},
"AuthorName": {
"type": "string"
},
"DeletedByEmail": {
"type": "string"
},
"DeletedByName": {
"type": "string"
},
"DeletedDate": {
"type": "string"
},
"DeletedDateLocalFormatted": {
"type": "string"
},
"DirName": {
"type": "string"
},
"DirNamePath": {
"type": "object",
"properties": {
"DecodedUrl": {
"type": "string"
}
}
},
"Id": {
"type": "string"
},
"ItemState": {
"type": "integer"
},
"ItemType": {
"type": "integer"
},
"LeafName": {
"type": "string"
},
"LeafNamePath": {
"type": "object",
"properties": {
"DecodedUrl": {
"type": "string"
}
}
},
"Size": {
"type": "string"
},
"Title": {
"type": "string"
}
},
"required": [
"odata.type",
"odata.id",
"odata.editLink",
"AuthorEmail",
"AuthorName",
"DeletedByEmail",
"DeletedByName",
"DeletedDate",
"DeletedDateLocalFormatted",
"DirName",
"DirNamePath",
"Id",
"ItemState",
"ItemType",
"LeafName",
"LeafNamePath",
"Size",
"Title"
]
}
}
}
}