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 Platform Community / Forums / Power Apps / PowerApp SharePoint Up...
Power Apps
Answered

PowerApp SharePoint Upload Button - Help with formula

(0) ShareShare
ReportReport
Posted on by 12

Hi guys,

 

I'm pretty new to Power Apps (an enthusiastic amateur!) and I'm having a bit of trouble getting a Flow to communicate with my App. More specifically I'm having trouble writing the formula to get it to work!

 

Using a guide made by Matthew Devaney I've managed to get my app working. However, all I'm now trying to do is add a notification to let the user know the flow has run successfully (or not). I now get an error stating 'Invalid Number of Arguments'. Would someone mind having a look and see if you can work out where I'm going wrong? I've probably missed a bracket or a comma somewhere, but I can't see where and I've run out of articles on Google to look at! 😁 

 

If(ForAll(DataCardValue2.Attachments As Document,'UploadtoSP(2)'.Run({contentBytes:Document.Value,name:Document.Name},ActivityName.Text,ddProductType.Selected.Value,ddUnit.Selected.Result,Text(Act_St_DatePckr.SelectedDate,"[$-en-US]yyyy-mm-dd"),Text(Act_End_DatePckr.SelectedDate,"[$-en-US]yyyy-mm-dd"),dd_Country.Selected.Value,ddPJHQ_JOA.Selected.Value,ddSub_Unit.Selected.'Sub-Unit',CB_Ent_Keywords.Selected.Value,CB_Ent_Keywords_1.Selected.Value,CB_Ent_Keywords_2.Selected.Value).success ="True",Notify("Uploaded successfully.",NotificationType.Success,10000),Notify("Upload failed.",NotificationType.Error,10000)));
 Reset(DataCardValue2);
 Reset(ddProductType);
 Reset(ddUnit);
 Reset(ddSub_Unit);
 Reset(ddPJHQ_JOA);
 Reset(ActivityName);
 Reset(Act_St_DatePckr);
 Reset(Act_End_DatePckr);
 Reset(dd_Country);
 Reset(CB_Ent_Keywords);
 Reset(CB_Ent_Keywords_1);
 Reset(CB_Ent_Keywords_2);

 Flow_1.pngFlow_2.png

Many thanks in advance!

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,805 Super User 2026 Season 1 on at

    Hi @robbo1 

     

    It's looking like Your ")" are all over the place

     

    If(ForAll(DataCardValue2.Attachments As Document,
    
    'UploadtoSP(2)'.Run(
     {contentBytes:Document.Value,name:Document.Name},
     ActivityName.Text,
     ddProductType.Selected.Value,
     ddUnit.Selected.Result,
     Text(Act_St_DatePckr.SelectedDate,
     "[$-en-US]yyyy-mm-dd"),
     Text(Act_End_DatePckr.SelectedDate,"[$-en-US]yyyy-mm-dd"),
     dd_Country.Selected.Value,
     ddPJHQ_JOA.Selected.Value,
     ddSub_Unit.Selected.'Sub-Unit',
     CB_Ent_Keywords.Selected.Value,
     CB_Ent_Keywords_1.Selected.Value,
     CB_Ent_Keywords_2.Selected.Value.success ="True")),
     Notify("Uploaded successfully.",NotificationType.Success,10000),
     Notify("Upload failed.",NotificationType.Error,10000)
     );

     

    try this code hope it sort some of the errors 

  • robbo1 Profile Picture
    12 on at

    Hi @SebS, thanks for replying! Apologies, that was a result of my clumsy attempt to fix it! Here is a neater version of the formula which is working - 

     

    ForAll(
     DataCardValue2.Attachments As Document,
     'UploadtoSP(2)'.Run(
     {
     contentBytes: Document.Value,
     name: Document.Name
     },
     ActivityName.Text,
     ddProductType.Selected.Value,
     ddUnit.Selected.Result,
     Text(
    	 Act_St_DatePckr.SelectedDate,
     "[$-en-US]yyyy-mm-dd"
     ),
     Text(
     Act_End_DatePckr.SelectedDate,
     "[$-en-US]yyyy-mm-dd"
     ),
     dd_Country.Selected.Value,
    	 ddPJHQ_JOA.Selected.Value,
     ddSub_Unit.Selected.'Sub-Unit',
     CB_Ent_Keywords.Selected.Value,
     CB_Ent_Keywords_1.Selected.Value,
     CB_Ent_Keywords_2.Selected.Value
     )
     );
     Reset(DataCardValue2);
     Reset(ddProductType);
     Reset(ddUnit);
     Reset(ddSub_Unit);
     Reset(ddPJHQ_JOA);
     Reset(ActivityName);
     Reset(Act_St_DatePckr);
     Reset(Act_End_DatePckr);
     Reset(dd_Country);
     Reset(CB_Ent_Keywords);
     Reset(CB_Ent_Keywords_1);
     Reset(CB_Ent_Keywords_2);

     

     I guess my question is really - How do I Insert the IF statement for the notification without breaking it! 🤣

     

    Your suggestion did not resolve the problem unfortunately.

     

  • Verified answer
    SebS Profile Picture
    4,805 Super User 2026 Season 1 on at

    @robbo1 

     

    I'm a donkey 😛

     

    You actually need to Wrap it 🙂

     

     

    If(
     'Power Automate Flow to Run'.Run().success = "True",
     Notify(
     "Flow has run successfully.",
     NotificationType.Success,
     2000
     ),
     Notify(
     "Flow run has failed.",
     NotificationType.Error,
     5000
     )
    );

     

     

     

     

     

     

     

     

    ForAll(
     DataCardValue2.Attachments As Document,
    IF(
     'UploadtoSP(2)'.Run(
     {
     contentBytes: Document.Value,
     name: Document.Name
     },
     ActivityName.Text,
     ddProductType.Selected.Value,
     ddUnit.Selected.Result,
     Text(
    	 Act_St_DatePckr.SelectedDate,
     "[$-en-US]yyyy-mm-dd"
     ),
     Text(
     Act_End_DatePckr.SelectedDate,
     "[$-en-US]yyyy-mm-dd"
     ),
     dd_Country.Selected.Value,
    	 ddPJHQ_JOA.Selected.Value,
     ddSub_Unit.Selected.'Sub-Unit',
     CB_Ent_Keywords.Selected.Value,
     CB_Ent_Keywords_1.Selected.Value,
     CB_Ent_Keywords_2.Selected.Value
     ).success = "True",Notify(
     "Flow has run successfully.",
     NotificationType.Success,
     2000
     ),
     Notify(
     "Flow run has failed.",
     NotificationType.Error,
     5000
     )
     );
     Reset(DataCardValue2);
     Reset(ddProductType);
     Reset(ddUnit);
     Reset(ddSub_Unit);
     Reset(ddPJHQ_JOA);
     Reset(ActivityName);
     Reset(Act_St_DatePckr);
     Reset(Act_End_DatePckr);
     Reset(dd_Country);
     Reset(CB_Ent_Keywords);
     Reset(CB_Ent_Keywords_1);
     Reset(CB_Ent_Keywords_2);

     

     

     

     

    Also rather write so many Reset create a variable at end of the code like below

     

     

     

    Set(varReset,true);
    Set(varReset,false)

     

     

     

    and now to each control property Reset add only varReset that will reduce the code

     

     

    ForAll(
     DataCardValue2.Attachments As Document,
    IF(
     'UploadtoSP(2)'.Run(
     {
     contentBytes: Document.Value,
     name: Document.Name
     },
     ActivityName.Text,
     ddProductType.Selected.Value,
     ddUnit.Selected.Result,
     Text(
    	 Act_St_DatePckr.SelectedDate,
     "[$-en-US]yyyy-mm-dd"
     ),
     Text(
     Act_End_DatePckr.SelectedDate,
     "[$-en-US]yyyy-mm-dd"
     ),
     dd_Country.Selected.Value,
    	 ddPJHQ_JOA.Selected.Value,
     ddSub_Unit.Selected.'Sub-Unit',
     CB_Ent_Keywords.Selected.Value,
     CB_Ent_Keywords_1.Selected.Value,
     CB_Ent_Keywords_2.Selected.Value
     ).success = "True",Notify(
     "Flow has run successfully.",
     NotificationType.Success,
     2000
     ),
     Notify(
     "Flow run has failed.",
     NotificationType.Error,
     5000
     )
     );
    Set(varReset,true);
    Set(varReset,false)

     

  • SebS Profile Picture
    4,805 Super User 2026 Season 1 on at

    @robbo1 

     

    Try above I edit it 🙂

  • robbo1 Profile Picture
    12 on at

    @SebS you are my hero - that worked! Thank you very much for your help! 😁👍

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 516

#2
WarrenBelz Profile Picture

WarrenBelz 428 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 292

Last 30 days Overall leaderboard