简体   繁体   English

Mulesoft Sharepoint 文件移动连接器

[英]Mulesoft Sharepoint File move connector

I am trying to build an Mulesoft application which will pick up a XML file from the folder on a Sharepoint site.我正在尝试构建一个 Mulesoft 应用程序,它将从 Sharepoint 站点上的文件夹中获取一个 XML 文件。 Once the file is dropped in to the folder I am trying to pick up and doing processing, creating records in Salesforce. Once it is picked up I need to remove (move) from the source folder to the archive folder, which I am not able to do it.一旦文件被放入我试图获取并进行处理的文件夹中,在 Salesforce 中创建记录。一旦它被获取,我需要从源文件夹中删除(移动)到存档文件夹,我无法这样做去做吧。

Below is the setting for the file pick up以下是文件拾取的设置

<flow name="listener-flow" doc:id="1a2f1eb3-0d64-45bd-9a61-9faf7b102c0d" >
    <sharepoint:created-objects doc:name="On New Objects" doc:id="c87373ee-8251-4f62-ae01-2a4969923d6e" config-ref="Sharepoint_Sharepoint_online" objectType="FILE" path="${sharepoint.listener.path}" recursive="true">
        <scheduling-strategy >
            <fixed-frequency frequency="${sharepoint.listener.polling.frequency}" timeUnit="SECONDS" startDelay="${sharepoint.listener.polling.startDelay}"/>
        </scheduling-strategy>
    </sharepoint:created-objects>
    <sharepoint:file-get-content doc:name="File get content" doc:id="c4ff33bb-d232-4194-a727-cb6e18ea83c5" config-ref="Sharepoint_Sharepoint_online" fileServerRelativeUrl="#[payload.ServerRelativeUrl]"/>
    <ee:transform doc:name="Map File Content to JSON" doc:id="70fbc3d7-9e37-4197-af61-5594cd6dc719" >
        <ee:message >
            <ee:set-payload ><![CDATA[%dw 2.0
                output application/json
                ---
                read(payload, 'application/xml')]]></ee:set-payload>
        </ee:message>
    </ee:transform>
    <sharepoint:file-move doc:name="File move" doc:id="2d604ac1-4d33-4e61-8310-9d59671fe9c1" config-ref="Sharepoint_Sharepoint_online" fileServerRelativeUrl="#[payload.ServerRelativeUrl]"/>
    

在此处输入图像描述

But I am not sure what should be the new file server relative url be但我不确定新文件服务器相对 url 应该是什么

在此处输入图像描述

In my YAML file I stored the archive path like below在我的 YAML 文件中,我存储了如下的存档路径

# Sharepoint
sharepoint:
  siteUrl: "https://XXXXXXXX.sharepoint.com/sites/D365XXXXX"
  auth:
    username: "CCCCCC@abc.org"
    password: "ABCDDD"
  listener:
    path: "/sites/D365Ad/NP Int/SF"
  archive:
    path: "/sites/D365Ad/NP Int/SF/Archive"
    polling:
      frequency: "60" # In seconds
      startDelay: "30" # In seconds

The ${sharepoint.archive.path} stores the archive folder path where the file has to to be moved. ${sharepoint.archive.path}存储必须将文件移动到的存档文件夹路径。 Alos if the source file name is XYZ I need to set the archived file name as sourcefilename_datetime.xml how or where can it be done.. Any help is greatly appreciated as this is my first project with Mulesoft Alos 如果源文件名是 XYZ,我需要将存档文件名设置为 sourcefilename_datetime.xml 如何或在哪里完成。非常感谢任何帮助,因为这是我使用 Mulesoft 的第一个项目

To use a property like ${sharepoint.archive.path} inside an expression use the p() function to get is value as p("sharepoint.archive.path") .要在表达式中使用类似${sharepoint.archive.path}的属性,请使用 p() function 获取值为p("sharepoint.archive.path") Then concatenate it with the file name and a timestamp.然后将它与文件名和时间戳连接起来。 Assuming the file name is stored in a variable called vars.filename :假设文件名存储在名为vars.filename的变量中:

#[p("sharepoint.archive.path") ++ "/" ++ vars.filename ++ "_" ++ now() as String {format:"yyyyMMddTHHmmss"} ++ ".xml"]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将文件从SharePoint库移动到UNC路径 - Move a file from a SharePoint library to a UNC path 在线Sharepoint-Powershell-重命名\\移动文件 - Sharepoint online - Powershell - Rename\Move file 我可以使用逻辑应用程序连接器获取文件内容(Sharepoint)获取历史 sharepoint 文件的内容吗? - Can i get the contents of historized sharepoint file with the logic app connector Get file Content (Sharepoint)? 使用 Powershell 将文件移动到 Teams SharePoint 目录 - Move file to Teams SharePoint directory using Powershell Kentico Sharepoint连接器:支持Sharepoint文档集 - Kentico Sharepoint Connector: Support of Sharepoint document sets SharePoint 连接器在 ping 标识中不起作用 - SharePoint Connector is not working in ping identity 以编程方式将本地文件移动并签入到Sharepoint C# - programmatically Move and Check in local file to Sharepoint C# 复制或移动替换文件并更新版本共享点 CSOM - copy or move replace file and update version sharepoint CSOM 使用 Power Automate 计划 Sharepoint 中文件的复制/移动和重命名 - Schedule the copy/move and renaming of a file in Sharepoint with Power Automate 如何将文件从一个 SharePoint 文件夹移动到另一个文件夹 - How to move a file from one SharePoint folder to another
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM