cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dominik_stefan
New Member

Problem with Power Automate and Sharepoint/Power Apps

Hello everyone,

 

im completly new to the Power Platform Tools and facing a problem in my first project.

 

I want to create a Power App which copy and paste a file from one sharepoint document library to another. The file(s) should be choosen inside the Power App through a catalog which displays the documents from a sharepoint library using a filter function.

 

 

Filter(Dokumente;'Folder path' = "Freigegebene Dokumente/PPT Dokumente/")

 

 

Inside this catalog there are checkboxes for selecting the files to be copied. 

 

dominik_stefan_0-1634417406952.png

 

For copying the selected files i created a flow in Power Automate: 

 

Screenshot.png

 For selecting the file to copy and the target folder i used: "Ask in Power Apps"

 

Then i inserted the flow in my Power App an linked it to a button. To run the flow it now asks for the two parameters (Which file i want to copy/The target Folder). Now i dont know how to set this two parameters in Power Apps.

 

dominik_stefan_1-1634418506567.png

 

The first one should be set through the checkboxes in the catalog and the last one through a dropdown which shows the folders in the sharepoint library.

 

It would be very nice if someone knows how to do that or can give me some advice for getting this done!

 

Thank you in advance!

 

Dominik

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @dominik_stefan ,

 

Please follow below steps:

1\ In Power Apps, Checkbox OnCheck and OnUncheck need to move current row's file identifier in/out of a collection to use in the Flow:

vjefferni_0-1634623709984.png

Items of designated folder selecting combo box:

Filter(Documents, IsFolder).'Full Path'

OnCheck of the check box:

Collect(files, ThisItem.Identifier)

OnUncheck of the check box:

RemoveIf(files, Value = ThisItem.Identifier)

OnSelect of flow trigger button:

Flow.Run(JSON(files.Value,JSONFormat.IgnoreBinaryData),ComboBox1.Selected.'Full Path')

 

2\ in Power Automate:

vjefferni_1-1634615543440.png

JSON schema:

{
  "Type": "array",
  "items": {
    "type": "object",
    "properties": {
      "Value": {
        "type": "string"
      }
    }
  }
}

Value expression of File to Copy:

items('Apply_to_each')?['Value']

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-jefferni
Community Support
Community Support

Hi @dominik_stefan ,

 

Please follow below steps:

1\ In Power Apps, Checkbox OnCheck and OnUncheck need to move current row's file identifier in/out of a collection to use in the Flow:

vjefferni_0-1634623709984.png

Items of designated folder selecting combo box:

Filter(Documents, IsFolder).'Full Path'

OnCheck of the check box:

Collect(files, ThisItem.Identifier)

OnUncheck of the check box:

RemoveIf(files, Value = ThisItem.Identifier)

OnSelect of flow trigger button:

Flow.Run(JSON(files.Value,JSONFormat.IgnoreBinaryData),ComboBox1.Selected.'Full Path')

 

2\ in Power Automate:

vjefferni_1-1634615543440.png

JSON schema:

{
  "Type": "array",
  "items": {
    "type": "object",
    "properties": {
      "Value": {
        "type": "string"
      }
    }
  }
}

Value expression of File to Copy:

items('Apply_to_each')?['Value']

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (3,251)