web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Form Upload Error

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I can't fix what's broke. Any ideas?

 

I get error message: Invalid number of arguments: received 5, expected 2 ' when I hover over the expression. Its my attempt at forcing the name of the file on the SP side to 'UnqID-CQYr-CQTitle'. That way the member can call it whatever they want and it won't impact query and filter on the database side while allowing the file to be recognizable to the eye in the library. 

 

Set(varFileLink, CertsQualsUploader.Run(Last(DataCardValue44.Attachments).Name, varBase64Only,Value(DataCardValue11.Text),DataCardValue7.Text,NewCQFormTitleDD.Selected.ClassTitles).sharepointfilelink);

 

FullNm:LookUp(SFPrgrmMmbrsCollection,UnqID=DataCardValue7.Text).UnqID,CQYr:Value(DataCardValue11.Text),NewCQFormTitleDD.Selected.ClassTitles

 

The system will take this edited version just fine - 

 

Set(varFileLink, CertsQualsUploader.Run(Last(DataCardValue44.Attachments).Name, varBase64Only).sharepoinfilelink);

 

Any thoughts?

Categories:
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about your flow's configuration?

     

    Regarding the error that you mentioned, it seems that there is something wrong with the parameter values specified in your  CertsQualsUploader.Run() function.

     

    From the error message that you mentioned, it seems to tell that the CertsQualsUploader.Run() function needs to receive two argument value, but you provided 5 arguments values in your first CertsQualsUploader.Run() function.

     

    If you want to pass 5 arguments from your canvas app to your flow, you need to define these 5 parameters in your flow firstly, and then you could provide proper value for these defined parameters through the CertsQualsUploader.Run() function in your canvas app.

    Note: You may need to re-create a new connection to your flow from your canvas app to make the parameter changes you made in your canvas app.

     

    More details about firing a flow from a canvas app, please check the following video resource:

    https://www.youtube.com/watch?v=1wl9AtxWdkg

     

    Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yep. Thanks! I rewrote and reattached and got it working.

     

    Thank you!

     

    If I may, currently the uploaded file is named whatever the owner named it. 

     

    In SP designer I was able to force a naming convention through the flow so that the file, once inside the environment, was named what we needed it to be named.

     

    I believe such a thing is possible in automate, by using the 'editing the expression' in the flow. I had it working, by accident. Now I don't remember how I did it. Any thoughts?

     

    The naming convention once uploaded to the SP library by the flow should be UnqID-Title-Yr; (all fields are available in the list).

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you want to rename the file created in your SP Library?

     

    Regarding the needs that you mentioned, I think the Work Flow Definition Language expression in Power Automate Flow could achieve your needs. If you want to concatenate multiple field values from your SP List to make the file name, I think the concat expression could achieve your needs:

    1.JPG

    Set the File Name field to following expression:

    concat(outputs('Get_item')?['body/Department'], '-',outputs('Get_item')?['body/DueDate'], '.jpg')

    Note: The '.jpg' represents the file extension name, you should change it to meet your needs.

     

    Please try above solution, then check if the issue is solved.

     

    Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I made the change and got this....

    The response from API 'sharepointonline' operation 'GetTable' with status code '200' does not contain a valid OpenAPI schema object.

     

    Flow Looks Like -

     

    1. PowerApps Trigger

     

    2, Get Item

     

    Site: https://powerapps... 

    List Name: Default-.../apps

    Id: Get item_Id

     

    3. Create file

     

    Site: https://sharepoint

     

    Folder Path: Desired library

     

    File Name: concat(outputs('Get_item')?['body/UnqID'], '-',outputs('Get_item')?['body/DteofAwrd'], '-',outputs('Get_item')?['body/CQTitle'])

     
    File Content:  base64ToBinary(triggerBody()['Createfile_FileContent'])
     
    4. Respond to a PowerApp of Flow
     
    SharePointFileLink: https.... Path
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share more details about your issue?

    Could you please share a screenshot about your flow's configuration?

     

    Regarding the expression value you specified within the File Name field and File Content field of the "Create file" action, I think there is something wrong with it.

     

    For File Name field in "Create file" action, you should append a file name extension into the concat expression, e.g.:

    concat(outputs('Get_item')?['body/UnqID'], '-',outputs('Get_item')?['body/DteofAwrd'], '-',outputs('Get_item')?['body/CQTitle'], '.jpg')

    If the CQTitle field value has already contains the file extension name, you could ignore above modified expression.

     

    For File Content field of the "Create file" action, you should use dataUriToBinary() function to convert the base64 encode image data passed from your canvas app instead of the base64ToBinary() function. You should modify the expression as below:

    dataUriToBinary(triggerBody()['Createfile_FileContent'])

     

    Please check and see if my solution in the following thread would help in your scenario:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Upload-document-from-powerapps-to-sharepoint/td-p/667972

     

    Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    In Power Apps you can create a Form and use the Form Attachment field (which only allow you to chose images), or you can 'steal' and attachment control from a form, clean it out and use it as the attachment. This allow you to attach any time of file; I chose this route.

     

    I've seen the process work. I did it a month or so ago. I file appeared on the other end with UnqID-Yr-Title. I just need to remember or be told how to build the concat on the flow. 

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Though what you suggest regarding the binary language may work, it was not the issue.

     

    The base64Binary (or whatever I used) worked the first time.

     

    I think I just need to figure out how to concatenate the pieces.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Yeah, you are right. Please check if the concat expression you used in your flow could return a proper file name including a File Extension Name.

     

    Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    What I currently have is the following. It works fine; in that it will upload the document the User attaches to the library I desire. 

     

    What it doesn't do is rename the file during upload.

     

    I desire a concatenate formula that will, in place of the  'Createfile-FileName', use the Member's 'UnqID', 'CQTitle', and DteofCQ as the file name when the item is created in the SP library.

     

    Capture 1.PNG

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Based on your flow's configuration, I think there is something wrong with it.  Are these 'UnqID', 'CQTitle', and DteofCQ columns from your SP List?

     

    If you want to use these 'UnqID', 'CQTitle', and DteofCQ column value from your SP List, you must acquire them firstly in your flow. The ['UnqID'], ['CQTitle'] and [DteofCQ] are all invalid expression in your flow, which could not get any column value from your SP List, it would throw argument error in your concat functino.

     

    If you want to get these 'UnqID', 'CQTitle', and DteofCQ column values, you could consider define these parameters in your flow, and then pass them from your canvas app. Or you could also consider add a "Get item" action in your flow, then specify the "Ask in PowerApps" dynamic content within the Id field as below:

    2.JPG

    then you could pass the Item ID value from your canvas app to your flow. And then within your flow, you could retrieve the specific List Item record based on the passed the Item ID value. After that, you could reference the column value from the "Get item" action in your concat expression.

    Note: You need to remove the Flow connection from your canvas app, then re-create a new connection to your flow, to make the changes (e.g. define new parameters in your flow) you made to your flow take effect in your canvas app.

     

    In your "Get file" action, you could use the following concat expression:

    concat(outputs('Get_item')?['body/Department'], '-', outputs('Get_item')?['body/DueDate'], '.jpg')

    Note: The outputs('Get_item')?['body/Department'] formula is used to retrieve the column value from above "Get item" action. You may need to try the following formula:

    outputs('Get_item')?['body/UnqID'] 
    outputs('Get_item')?['body/CQTitle'] 

    ...

    ...

     

    Please try above solution, then check if the issue is solved.

     

    Regards,

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard