cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

run parameters for flow in powerapps, createfile, file content & file path

Please i am trying to use a flow that allows users to upload a pdf or docx file to a sharepoint site from powerapps. i have tried to add the flow in powerapps but not sure what the values for the run parameters file name, file content & file path should be, as i intend for it to be dynamic.

 

when i created the flow i chose the ask in powerapss option, but dont know how to complete the process in powerapps. thank you.flow.png

cheers,

Aj.

17 REPLIES 17
Community Support Team
Community Support Team

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Aj01,

 

I guess that you have created a flow looks like below. May I suggest you configure the Folder Path when you creating the flow?

1.PNG

Then you could create an app and configure the OnSelect property of a button as savefilefrompowerapps.Run(TextInput1.Text,TextInput2.Text).

2.PNG

 

Hope this could be a reference for you.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Mabel,

 

Thank you for your response. Please can I just clarify, what folder path am I to use in creating the flow? The point is , I want people to be able to upload documents from their phones or laptops, so if I put a fixed folder path, would it still allow for this to happen? and how do I choose which folder path to use? Thank you.

 

Cheers,

Ajoke

Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

HI Mabel,

 

I tried to add a folderpath like you suggested. Apart from not knowing what to do, I clicked on that folder icon by the side and this was the error message - 

  • error executing the api datasets/https%253A%252F%252Funilever.sharepoint.com%252Fsites%252FTalentSpottingGhana%252FTalent%252520Spotting%252520Ghana%252FForms%252FAllItems.aspx/rootfolders
  • *File name
    Please what does this mean? Thank you.
     
    Cheers,
    Aj
Community Support Team
Community Support Team

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Aj01,

 

When creating the flow, I tried to configure the Folder Path as “Ask in PowerApps”. As currently we are not able to create a connection from PowerApps to SharePoint library, so I was not able to configure the Folder Patch in the app.
So I tried to configure the Folder Path as the library which has been created in SharePoint site. Just as the screenshot I provided before.

 

From the error message, I assumed that you were not using the right Site URL, please enter the URL of your site, then click the “Show Picker” button to select the folder path.


About how to specify a SharePoint site, hope this document could be a reference for you:
https://powerapps.microsoft.com/en-us/tutorials/app-from-sharepoint/

 

Please feel free reply if you need more help.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Mabel,

 

Thank you I made some progress today. I specified only the URL, and I was able to get options for the folders. A couple of things though,

 

1. My document library didn't show up in the list of folders (I chose documents as it was the closest.

2. When I wanted to define onselect parameters, the values as specified below didn't work and it still promted me for createfile_filename, etc,filecontent,filepath so not sure what to do next. I put in the Text1.text etc , but that didn't work.

 

This seems to be the missing part of the puzzle (and of course why my new folder wasn't showing). Thanks a lot.

 

Cheers,

Ajoke

 

Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

I wanted to attach a picture, please see below.

issues2.png

 

Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Mabel,

 

Please I am still expecting a reply on this. I am stuck on running the flow in powerapps. After specifying folder path in flow, on specifying the onselect parameters I am still being asked to input file name, content type , folder path and it is rejecting the suggested textinput1.text, etc Please help.

 

Thanks a lot,

Aj

Community Support Team
Community Support Team

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Aj01,

 

Have you created a Document library in SharePoint Online? In the screenshot I provided before, I selected "test library3", as I have already created this library. So if you have one, you should be able to select it when configuring "Folder Path".

 

Please try to delete the old flow then recreate a new one, then add it to the app.
I found that if I just update the flow, the changes would not reflect directly on the app, delete and recreate the flow would be helpful.

 

Please try it and let me know if it works.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Mabel,

 

Things are getting really frustrating over here. I created a new flow, still the run parameters, where TextInput1.Text,TextInput2.Text were still not accepted. I am not sure what to do. On the flow page I got the following error message

 

Flow run timed out because the starting action was not performed. Please try again

 

Also I noticed that both the CDS and the Sharepont sites were not available to be connected to my edit form. It's really

frustrating.

 

Cheers and thanks so far,

Aj

Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Mabel,

 

Please see below a picture showing the error. Please did I miss anything?

last one.png

 

It shows invalid name.

 

Cheers and thank you.

 

Aj 

Community Support Team
Community Support Team

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Aj01,

 

About the flow you have created, the run parameters that are needed in the function box should be the actual name of the Text input controls on your app.


Please try to click the Text input controls under “Your Name” and “Your Email” to get the actual name of the Text input controls. By selecting the control, you could get the name at here:

2.PNG

 

Then when you run the flow, a file named as “Your Name” will be saved to the library, and the file content would be “Your Email”.

 

But please check this thread, currently it is not possible to attach a file to a form so there is not control can be used to open up a file picker and select the file and upload the file to Library or other destinations.
https://powerusers.microsoft.com/t5/PowerApps-Forum/Attachment-upload-to-library/m-p/8133/highlight/...

 

Also, you could vote the idea at here, and seems that this idea has a status “Planned”, I guess this feature would be coming soon:
https://powerusers.microsoft.com/t5/PowerApps-Ideas/Attach-a-file-to-form/idi-p/20596


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Mabel,

 

Thank you for your response. The thing is I am not particular about attaching the file to the form. All I want to achieve is upload the file to sharepoint from Powerapps. I have even changed the design of the app and taken away the form and now all you do is click the upload button and select file. I want the resultant action to be that the file is uploaded to sharepoint (without the form).

 

I'm not sure I understand the text input control. Are you saying I should create a text input box where the name of the file would be spelt out? Can I achieve the above? Without a form because if that cannot be achieved, then I wonder why the flow exists?

Also I realised that when I click on the upload control, it opens mybrowse file window but all the files are greyed out, they cannot be selected. Please help because this function would take away a lot of my troubles.

 

Cheers,

Aj

Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Mabel,

 

Please I am still expecting your response. Thank you.

 

Cheers,

Aj

 

 

 

Community Support Team
Community Support Team

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi Aj,

 

Apologize for late response.

 

What do you mean by this “Upload control”? Is it the “Import” control under Controls or the “Add picture” control under Media? I am not sure with this.

 

Could you help to clarify this statement “Also I realised that when I click on the upload control, it opens mybrowse file window but all the files are greyed out, they cannot be selected”?
I am not able to reproduce this on my side, how could you do this?

 

By using a flow to create a file to SharePoint library, we can only specify the File Name and File Content using Text input controls. About your questions:
Yes, we should use a Text input control for the file name. It can be achieved by using Flow.
And currently PowerApps only support the connection to SharePoint list but not library, for the file content, we are not able to select files by opening the browse file window, so only text input controls can be used for it.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JimmyS
Level 8

Re: run parameters for flow in powerapps, createfile, file content & file path

PowerApp_UploadFlow.jpg

 

I agree that this is beyond frustration. I have spent 8 hours tring to get my first Flow to flow (no pun intended). I created a Library in Sharepoint Online to store my photos. I created a Flow titled; Upload a Photo to Sharepoint from Power Apps. As the title inplies, I would like to upload a photo from PowerApps to my Sharepoint Library, NOT to Sharepoint list, which I know is not currently possible.

 

When I created my Flow, Dynamic content was added for the File Name & File Content fields. Createfile_Filename & Createfile_FileContent. In PowerApps I have tried creating both an AddPicture & Image control, and then adding them to my flow as;

UploadphotototoSharePointfromPowerApps.Run(AddMediaButton3,TextInput1.Text) where AddMediaButton3 is an AddPicture control and TextInput1 is a simple text input control.

or;

UploadphotototoSharePointfromPowerApps.Run(Image3,TextInput1.Text) where Image3 is an Image control and TextInput1 is a simple text input control.

 

Both of these bring up errors, specifically, "Invalid number of arguments". I have tried adding; Media, Text, Image, Picture, and several other terms to the end of the mmedia or image control with no success.

 

I have read through this thread and others indicating that both of these fields; FileName & FileContent need to be text fields. But then, how is the Flow supposed to upload a photo? I am totally stumped and cannot find one verifiable example describing what these two fields are supposed to contain.

 

I have successfully tried two different methods to copy photos to Excel via OneDrive using Patch. But I wanted to see how the Flow would work. But I have been striking out so far.

 

 

Anonymous
Not applicable

Re: run parameters for flow in powerapps, createfile, file content & file path

Have exactly the same problem here and tried to find a solution for hours .... it's really frustrating that it seems not to be possible to send multiple variables/values from PowerApps to Flow (or backwards).

Any news out there?

KYamazaki0207
Level: Powered On

Re: run parameters for flow in powerapps, createfile, file content & file path

Hi everyone,

 

Sorry if I'm a little too late, but I've been having this issue and just found the solution.  No tricks - it's pretty easy:

 

  1. Ensure the name of your flow matches the "Ask in Powerapps" Flow variable (all characters before the underscore) that you're trying to pass, i.e. if your variable's name is "Sendanemail_To," then your Flow must be named "Sendanemail"
  2. Check how many copies of the same variable exist as an option in your Flow by clicking on the variable and scrolling to the bottom of your variable option window that pops up.  The number of copies will determine the number of arguments that you must include in the Run command in PowerApps, i.e. if you have "Sendanemail_To, Sendanemail_To_1,Sendanemail_To_2" available, you'll need to include three arguments in your Run command.
  3. At this point you may have to force PowerApps to recogize the updated flow immediately by either or all: (a) restarting PowerApps, (b) turning the flow off and turning it back on,/re-doing the Flow from scratch or via copying the Flow and deleting the original, ensuring the remaining copy is named per step #1.
  4. In Powerapps, assign your Flow as usual, and format the Run command parameters per this example: Sendanemail.Run(Text1,Text2...) where "Text" is either a Label or TextInput (with ".Text" appended, of course) or if you'd like to pass text directly as a parameter, just include whatever text you need enclosed in quotation marks.  In my case, I can either pass an email address enclosed in quotes, an email address that's a DataCardValue/Label/TextInput, or User().Email if I wanted an email sent to the user.
  5. Lastly, make sure that your number of arguments matches the number of variables per step #2.  If you don't need that many variables, assign double-quotes ("") in place of the variable.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 213 members 5,319 guests
Recent signins:
Please welcome our newest community members: