Automate

 View Only
  • 1.  Microsoft Power Automate & Foundation

    Posted 03-12-2024 13:39

    Hi All

    I am looking to use Power Automate to pull files from a user folder within the Query Data Files folder in Foundation, then email them to specific people. I have had success pulling a single specifically named file and emailing it. However, Power Automate can't seem to grab a file when added to the folder. Has anyone had any success with this?

    • I am a Foundation application admin so I have ALL of the permissions. IT has also given me gateway access. 
    • If using Power Automate is not an option, is Winshuttle Foundation workflow an option? I started poking around workflow, however I don't seem to be finding what I need. 
    • I also don't have the ability to have the folder itself automatically share the files. The option is turned off and I'm not sure if this is a missing SharePoint function, or if it's just something that needs to be turned on within our servers. 

    Any guidance, suggestions are greatly appreciated. 



    ------------------------------
    Vanessa Kutasi
    Foundation Admin./Application Analyst II
    Idexx Operations, Inc.
    USA
    ------------------------------


  • 2.  RE: Microsoft Power Automate & Foundation

    Employee
    Posted 03-13-2024 02:50

    Hi Vanessa,

    You can try creating a workflow with "Add Attachment" plugin to fetch the file on the form in an attachment element and then use "send email" plugin to email it to the users.

    So typically your workflow will look like :

    Start -> Add Attachment plugin -> send email plugin -> end.

    Only shortcoming for this approach is that you can only pull one attachment at a time using add attachment plugin, so you need to have the exact name and number of the files to be fetched so that you can configure the "Add attachment plugin" accordingly.

    please refer link on plugin guide for more details : https://winshuttle-help.s3.amazonaws.com/foundation/en/composer/composer-plugins-add-attachment.htm

    Hope this helps.

    Regards



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 3.  RE: Microsoft Power Automate & Foundation

    Posted 03-13-2024 11:39

    Thank you Hammad!

    Is there a plugin that is capable of fetching the file from a library in Foundation?



    ------------------------------
    Vanessa Kutasi
    Foundation Admin./Application Analyst II
    Idexx Operations, Inc.
    USA
    ------------------------------



  • 4.  RE: Microsoft Power Automate & Foundation

    Posted 03-13-2024 07:47

    I'm sure you have explored what you can do in STUDIO?

    https://help.precisely.com/r/Automate-Studio/20.3/en-US/Automate-Studio-with-Connect-User-Guide/Query/Run-Scripts/Schedule-a-Query-run

    I know it might limitation to do autimation on your own workstation, but we have helped our customers to run these on virtual workstations, with some codíng utilizing command line runs. If you explore this more, make sure you stay compliant with Licencing recarding human and bot users. 



    ------------------------------
    Tuomas Silvennoinen
    Account Manager
    Adsotech Scandinavia Oy
    Espoo
    ------------------------------



  • 5.  RE: Microsoft Power Automate & Foundation

    Posted 03-13-2024 10:42

    Hi Tuomas,

    We use Studio to execute the query, scheduled via the server. I am aware we can schedule the query locally, and email that way. However, this isn't ideal as the users computer needs to be on and connected to our network. I appreciate the thought. 



    ------------------------------
    Vanessa Kutasi
    Foundation Admin./Application Analyst II
    Idexx Operations, Inc.
    USA
    ------------------------------



  • 6.  RE: Microsoft Power Automate & Foundation

    Employee
    Posted 03-13-2024 15:05

    Hi Vanessa,

    To download the file from the sharepoint list into a folder using workflow, you can make make use of "Execute Powershell" plugin.

    https://winshuttle-help.s3.amazonaws.com/foundation/en/composer/composer-plugins-execute-powershell.htm

    The powershell command file is attached below. provide the URL and and destination path, this will download the file, then use "add attachment plugin" to retrieve this file on to the form.

    I have a solution created on Evolve that is currently working for customer, attached the solution as well for reference.

    use link https://nowtransfer.de/eb06cdaaf0d1 to download.

    Hope this helps.

    Regards



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------



  • 7.  RE: Microsoft Power Automate & Foundation

    Posted 03-14-2024 08:43

    Thank you Hammad! Unfortunately, we are not using Evolve so I am unable to view the solution. I am trying the powershell command/add attachments plugin but so far have been unsuccessful. 



    ------------------------------
    Vanessa Kutasi
    Foundation Admin./Application Analyst II
    Idexx Operations, Inc.
    USA
    ------------------------------



  • 8.  RE: Microsoft Power Automate & Foundation

    Employee
    Posted 03-15-2024 12:38

    Hi Vanessa,

    I gave it a try to download the file from sharepoint document library, this is the closest i can get.

    ------------------ // powershell command starts here

    #Config Variables
    $SiteURL = "http://sharepoint2016/formex/"
    $FileServerRelativeURL = "http://sharepoint2016/formex/HNDocs/"
    $DestinationFolder ="C:\Test"
     
    Try {
         #Check if the Destination Folder exists. If not, create the folder for targetfile
         If(!(Test-Path -Path $DestinationFolder))
         {
            New-Item -ItemType Directory -Path $DestinationFolder | Out-Null
            Write-host -f Yellow "Created a New Folder '$DestinationFolder'"
         }
     
        #Connect to PnP Online
        Connect-PnPOnline -Url $SiteURL 
         
        #Check if File exists
        $File = Get-PnPFile -Url $FileServerRelativeURL -ErrorAction SilentlyContinue
        If($File -ne $Null)
        {
            #Download file from sharepoint online
            Get-PnPFile -Url $FileServerRelativeURL -Path $DestinationFolder -Filename $File.Name -AsFile -Force
            Write-host "File Downloaded Successfully!" -f Green
        }
        Else
        {
            Write-host "Could not Find File at "$FileServerRelativeURL -f Red
        }
    }
    Catch {
        write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
    }

    ----------------

    The PowerShell command above prompts for credential window to log on to SharePoint site and then download the file.

    I couldn't find a away to pass creds while executing the PowerShell from the plugin. just posting it here just incase anybody knows a way to logon to pass creds.

    --------------------

    Regards



    ------------------------------
    Hammad Naeem
    Precisely Software Inc.
    ------------------------------