Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

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

(0) ShareShare
ReportReport
Posted on by

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.

  • KYamazaki0207 Profile Picture
    KYamazaki0207 14 on at
    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.
  • 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?

  • JimmyS Profile Picture
    JimmyS 97 on at
    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.

     

     

  • v-yamao-msft Profile Picture
    v-yamao-msft on at
    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

  • 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

     

     

     

  • 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

  • v-yamao-msft Profile Picture
    v-yamao-msft on at
    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/true#M3575

     

    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

  • 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 

  • 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

  • v-yamao-msft Profile Picture
    v-yamao-msft on at
    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard

Featured topics