cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimoMigchielsen
Post Prodigy
Post Prodigy

Getting information from powerapps to flow

Hello there! I am using the following flow to send pictures from Power Apps to SharePoint using Power Automate. https://gyazo.com/3f22452665a9415b8444801f2e42eb7c

I want it to create a folder on a certain location and put the files inside of it. But the name has to match up with the order nummer that has been filled in power apps, is this possible?

I use this function to start the flow: 

 

Set(varDemoFromAttachmentControl; JSON(Image2.Image; IncludeBinaryData));;
Set(varBase64Only; Mid(varDemoFromAttachmentControl; Find(","; varDemoFromAttachmentControl)+1; Len(varDemoFromAttachmentControl) - Find(","; varDemoFromAttachmentControl) -1 ));;
Set(varFileLink; EasyUpload.Run(Last(AttachmentControl.Attachments).Name; varBase64Only).sharepoint_link);;

 

 
I am using the attachment control for this: https://gyazo.com/fb48f78d53360462727461e9b18e512c

31 REPLIES 31
Alex_10
Super User
Super User

What if you try this:

Set(varFileLink;
    EasyUpload.Run(
        Trim(YourOrderNumberInput.Text) &
            If(!IsBlank(Last(Split(Last(AttachmentControl.Attachments).Name, ".")).Result),
                "." & Last(Split(Last(AttachmentControl.Attachments).Name, ".")).Result,

                ""
            );
        varBase64Only
    ).sharepoint_link
);;

v-bofeng-msft
Community Support
Community Support

Hi @TimoMigchielsen :

I don't see any problem from your description.Could you tell me:

  • Is your flow working normally? Can the picture be saved normally?
  • Does the return value of your flow meet your expectations? What is its purpose?
  • Does your solution refer to a certain tutorial? Can I refer to it?(I need to know how flow is set up)
  • Whether there may be attachments in non-picture format in AttachmentControl?

Which of the two situations I described is correct? If they are not correct, could you describe your specific requirements in detail?

  • Do you want to replace Last(AttachmentControl.Attachments).Name with order nummer as the name of the picture?
  • Is Last(AttachmentControl.Attachments).Name an order nummer?

Best Regards,

Bof

Hello! Thank you for your answer @v-bofeng-msft 

My flow is working correctly normally. It is taking the name of the file to save it to SharePoint. If you save a picture named "Image1.jpg" it will take the name and create the file.

 

The return value is just to have a button on Power Apps that leads to this file location. Code for the button:

Launch(varFileLink)

 
Yes, I have been using this tutorial from Shane Young. https://www.youtube.com/watch?v=3QaiM8SeWfM

There can be PDF's & Images in the attachment control. 

Do you want to replace Last(AttachmentControl.Attachments).Name with order nummer as the name of the picture? = true in a way, but not fully.

This is how I want it to be. I want it to check if there is a folder with the ordernummer & "-" & deelorder. (Example: 18037-31). If it exists, put the attachments in there. If the folder does not exist, create it using the same formule: ordernummer & "-" & deelorder

Last(AttachmentControl.Attachments).Name an order nummer? = Not true at the moment. This currently just takes the name of the file. This code is being used to link back to the image that has been filled in. If we can get the folder to work. I'd like to just check the ordernummer & "-" & deelorder of the form that has been filled in and link to that folder so if you click on the button, you open that folder.

If we get the folder thing to work, we can leave the name of the attachment as it is. Just need to store them in that folder with the project name.

Hopefully I made this more clear to you. Thanks in advance for your respond! 



Why did this message get solved? It is not working at all? @v-bofeng-msft 

Hi @TimoMigchielsen :

I originally wanted to reply, but seeing that this topic has been marked saved, I thought your problem has been solved.Maybe you can cancel it?
Please wait a moment.

Best Regards,

Bof

Hi @TimoMigchielsen :

Could you tell me:

  • what is the folder with the ordernummer & "-" & deelorder. you mentioned?
  • Is it a folder in a SP library? If so, what is the SP library?

According to your description, the name of the picture may be

  • the name of the referenced folder
  • a custom name
  • the name of the attachment in the Attachment control.

Could you describe the judgment conditions in detail? My current understanding is:
Possibility 1: Check whether there is a folder in a SPlibrary that conforms to the 18037-31 format. If it exists, use the name of the folder as the picture name. If it does not exist, use the formula ordernummer & "-" & deelorder
Possibility 2: Check whether there is a folder name equal to ordernummer & "-" & deelorder in a certain SPlibrary, if it exists, use the name of the folder as the picture name. If it does not exist, use the formula Last(AttachmentControl.Attachments).Name

Best Regards,

Bof

I marked it as not the solution. @v-bofeng-msft 

Thank you for helping me!

Link to where the folder needs to be created at:  DELETED

 

 


It needs to check if there is a folder available with the following name: ordernummer & "-" & deelorder. If there is no folder, create one. After this, it needs to put the attachments in this folder.

So if I work on different projects with different ordernummers, it should be saved in another folder.  

At the moment we have nothing to do with the attachments name, with the code I am using right now, it just takes the name of the attachments and saves it like this. Which is fine. 

Hi @TimoMigchielsen :

Please pay attention to personal information security: I recommend deleting the above link.

Best Regards,

Bof

Hi @TimoMigchielsen :

Let me sort out your needs, if there are errors, please help me point them out:
1. Determine whether ordernummer & "-" & deelorder is equal to a file name in the SP library.
The judgment is established:
2. Save the picture in this folder
The judgment is not valid:
2. Create a folder with the same name and save the file in this folder

Best Regards,

Bof

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,748)