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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Invalid number of argu...
Power Apps
Unanswered

Invalid number of arguments appears when removing/adding flow to app

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hello,

I have an issue with my app where  1) when other users are trying to run the app - they are seeing this message about the Encodian connection when running the app - the connection for this is shared to a security group that the users are a member of - I have also tested this with an independent user account but annoyingly experiencing same issue.

sudosaurus_1-1695984130824.png

As Encodian support has suggested, they asked me to remove the flow from my app and re-add it - having done so, I am seeing the below on my button fx in the app

sudosaurus_2-1695986097673.png

This was working for my own account before I removed the flow and added it back into the app as you can see from the below:

sudosaurus_12-1695988494131.png

 

My flow is setup as below:

 

sudosaurus_3-1695986203913.png

sudosaurus_5-1695987059661.png

sudosaurus_7-1695987129426.png

sudosaurus_8-1695987192528.png

Concat (HTML data) - for the below Encodian action

concat('<!DOCTYPE html>
<html>
<body>
<table style="width: 100%;">
<tr>
<td>
',triggerBody()['text'],'
</td>
</tr>

<tr>
<td>
<img src="',outputs('Compose_-_Photo_to_base64'),'" />
</td>
</tr>

<tr>
<td>
',triggerBody()['text_3'],'
</td>
</tr>

<tr>
<td>
',outputs('Compose'),'
</td>
</tr>

<tr>
<td>
',triggerBody()['text_4'],'
</td>
</tr>

</table>



</body>
</html>')

sudosaurus_9-1695987265233.png

sudosaurus_10-1695987339738.png

sudosaurus_11-1695987383658.png

In my app, I am using the following HTML text controls which use html as follows - these are the ones that are referenced in the .Run button Fx:

 

htmlBody_1

"
<h2><font color=blue>BUILDING SAFETY CASE REPORT HEADINGS</font></h2>
<h3>COVER PAGE</h3> 
•	Name and address of property: "&LookUp(Buildings,Title=varItem.spBuilding).Title & ", " &LookUp(Buildings,Title=varItem.spBuilding).Address &"<br>
•	National UPRN: "&LookUp(Buildings,Title=varItem.spBuilding).NatUPRN & "<br>
•	LiveWest UPRN: "&LookUp(Buildings,Title=varItem.spBuilding).CxUPRN & "<br>
•	BSR Code: "&LookUp(Buildings,Title=varItem.spBuilding).BSRAppNo & "<br>
"

htmlBody_2

"
<h3>CONTENTS PAGE</h3>
<h3>1.	DOCUMENT CONTROL AND EXECUTIVE SUMMARY</h3>
1.1.	Document control table: Test data<br> 
1.2.	Executive summary with overarching claim, argument, and RAG rating<br><br>
<h3>2.	GENERAL INFORMATION</h3>
2.1.	Building name and address: "&LookUp(Buildings,Title=varItem.spBuilding).Title & ", " &LookUp(Buildings,Title=varItem.spBuilding).Address &"<br>
2.2.	Location and site description<br>
2.3.	Relevant persons<br>
2.3.1.	 Building owner: "&LookUp(Buildings,Title=varItem.spBuilding).'Building Owner' & "<br>
2.3.2.	 Accountable person: "&LookUp(Buildings,Title=varItem.spBuilding).'Principal Accountable Person' & "<br>
2.3.3.	 Other accountable persons: "&LookUp(Buildings,Title=varItem.spBuilding).'Other Accountable Persons' & "<br>
2.3.4.	 Responsible persons<br>
2.3.4.1.	Head of Building Safety: "&LookUp(Buildings,Title=varItem.spBuilding).'Head of Building Safety' & "<br>
2.3.4.2.	Fire Safety Manager: "&LookUp(Buildings,Title=varItem.spBuilding).'Responsible Persons Under Fire Safety' & "<br>
2.3.4.3.	Other responsible persons: "&LookUp(Buildings,Title=varItem.spBuilding).'Other Responsible Persons' & "<br>
2.4.	The building<br>
2.4.1.	 Description of the building: "&LookUp(Buildings,Title=varItem.spBuilding).'Category of Provision' & "<br>
2.4.2.	 Design and construction: Test data<br> 
2.4.3.	 Refurbishments: Test data<br>
2.4.4. Additional photos: Test data<br>

"

htmlBody_3

"
2.4.5.	 Floor plans: Test data<br>
2.4.6.	 Elevation plans: Test data<br>
2.4.7.	 Description of the site: Test data<br>
2.4.8.	 Site plan and map: Test data<br>
2.4.9.	 Utilities: Test data<br>
2.4.10.	 Resident profile: Test data<br>


<table>
"&

Concat(colSubtopics,
"<tr><td><H3>"& Order+2 &" " & Value&"</H3>
<table>
<tr><td><b>Claim</b></td></tr>
<tr><td>"&LookUp(TopicsClaims,Building=varItem.spBuilding).Claim&"</td?></tr>
"
&
Concat(Filter(colAllSubtopics,TopOrder=Order+2),
"<tr><td><H4>"& SubTopOrder & " " & SubTop &"</H4></td></tr>

<tr><td><b>Argument</b></td></tr>
<tr><td>"&Arg&"<br><br></td></tr>
<tr><td><b>Evidence</b></td></tr>
<tr><td>"&Evid&"<br><br></td></tr>
"



)
 
 
&


"





</table>




</td></tr>"


)

&"
</table>

<h3>"& Value(Last(colSubtopics).Order+3) &". ONGOING WORKS AND IMPROVEMENTS (all free text)</h3>
"& Value(Last(colSubtopics).Order+3) &".1.	External wall remediation programme<br>
"& Value(Last(colSubtopics).Order+3) &".2.	Fire Risk Assessment actions<br>
"& Value(Last(colSubtopics).Order+3) &".3.	Fire door works<br>
"& Value(Last(colSubtopics).Order+3) &".4.	Internal compartmentation works<br>
<h3>"& Value(Last(colSubtopics).Order+4) &". THE BUILDING SAFETY CASE (all free text)</h3>
"& Value(Last(colSubtopics).Order+4) &".1.	How evidence is provided for the Building Safety Case Report<br>
<h3>"& Value(Last(colSubtopics).Order+5) &". REVIEWING AND UPDATING THE BUILDING SAFETY CASE AND REPORT</h3>
<h3>"& Value(Last(colSubtopics).Order+6) &". CLOSING STATEMENT AND SIGN OFF BOX</h3>


<br><br>
<b>Cover Page</b> <br><br>
<table border='1' style='border: 1px solid black; border-collapse: collapse'>
<tr><td width='200px'>DATE OF REPORT:</td><td width='450px'>"&Text(Today(),"dd/mm/yyyy")&"</td></tr>
<tr><td>VERSION:</td><td>1.0</td></tr>
<tr><td>BSR CODE:</td><td>"&LookUp(Buildings,Title=varItem.spBuilding).BSRAppNo&"</td></tr>
<tr><td>NATIONAL UPRN:</td><td>"&LookUp(Buildings,Title=varItem.spBuilding).NatUPRN&"</td></tr>
<tr><td>LIVEWEST UPRN:</td><td>"&LookUp(Buildings,Title=varItem.spBuilding).CxUPRN&"</td></tr>
<tr><td>PREPARED BY:</td><td>"&varItem.'Created By'.DisplayName&"</td></tr>
<tr><td>APPROVED BY:</td><td>Test data</td></tr>


</table>

<br><br>
<b>Version Control</b> <br><br>
<table border='1' style='border: 1px solid black; border-collapse: collapse'>

<tr style='background-color:#efefef'><th>Version</th><th>Date</th><th>By Whom?</th><th>Reason</th></tr>
<tr><td width='100px' style='text-align:center'>1.0</td><td width='100px' style='text-align:center'>"&Text(Today(),"dd/mm/yyyy")&"</td><td width='200px' style='text-align:center'>"&varItem.'Created By'.DisplayName&"</td><td width='250px'>Test data</td></tr>

</table>

"

 

This is the full Fx code I have on my flow run button:

Set(varItem,ThisItem);
Set(varBuildingPhoto,LookUp(BuildingPhotos,Title=ThisItem.spBuilding).'Link to item');
Set(varBuildingPhotoID,LookUp(BuildingPhotos,Title=ThisItem.spBuilding).ID);

// THIS INCLUDES ALL THE TOPIC HEADERS
ClearCollect(colSubtopics1, Distinct(Filter(SubtopicArgEvi_1,Building=varItem.spBuilding),Topic));

// THIS IS THE DISTINCT COLLECTION OF ORDER OF TOPICS
ClearCollect(colSubtopics, ForAll(Sequence(CountRows(colSubtopics1)), Patch(Last(FirstN(colSubtopics1,Value)),{Order:Value})));

ClearCollect(colTempAllSubtopics, AddColumns(Filter(SubtopicArgEvi_1,Building=varItem.spBuilding),"TopicOrder",0,"SubtopicOrder",0));
Clear(colTempAllSubtopicsB);
ForAll(colTempAllSubtopics, Collect(colTempAllSubtopicsB, {
 Top: colTempAllSubtopics[@Topic], 
 SubTop: colTempAllSubtopics[@Subtopic] & " - " & colTempAllSubtopics[@'Subtopic Breakdown'],
 Arg: colTempAllSubtopics[@Argument],
 Evid: colTempAllSubtopics[@Evidence],
 TopOrder: LookUp(colSubtopics,Value=colTempAllSubtopics[@Topic]).Order+2
}));

Clear(colAllSubtopics);

 Collect(colAllSubtopics, ForAll(Sequence(CountRows(Filter(colTempAllSubtopicsB, TopOrder=3)), 3.1, 0.1), Patch(Last(FirstN(Filter(colTempAllSubtopicsB, TopOrder=3), Value)), {SubTopOrder: RoundUp(Value, 2)})));
 Collect(colAllSubtopics, ForAll(Sequence(CountRows(Filter(colTempAllSubtopicsB, TopOrder=4)), 4.1, 0.1), Patch(Last(FirstN(Filter(colTempAllSubtopicsB, TopOrder=4), Value)), {SubTopOrder: RoundUp(Value, 2)})));
 Collect(colAllSubtopics, ForAll(Sequence(CountRows(Filter(colTempAllSubtopicsB, TopOrder=5)), 5.1, 0.1), Patch(Last(FirstN(Filter(colTempAllSubtopicsB, TopOrder=5), Value)), {SubTopOrder: RoundUp(Value, 2)})));
 Collect(colAllSubtopics, ForAll(Sequence(CountRows(Filter(colTempAllSubtopicsB, TopOrder=6)), 6.1, 0.1), Patch(Last(FirstN(Filter(colTempAllSubtopicsB, TopOrder=6), Value)), {SubTopOrder: RoundUp(Value, 2)})));
 Collect(colAllSubtopics, ForAll(Sequence(CountRows(Filter(colTempAllSubtopicsB, TopOrder=7)), 7.1, 0.1), Patch(Last(FirstN(Filter(colTempAllSubtopicsB, TopOrder=7), Value)), {SubTopOrder: RoundUp(Value, 2)})));
 Collect(colAllSubtopics, ForAll(Sequence(CountRows(Filter(colTempAllSubtopicsB, TopOrder=8)), 8.1, 0.1), Patch(Last(FirstN(Filter(colTempAllSubtopicsB, TopOrder=8), Value)), {SubTopOrder: RoundUp(Value, 2)})));
 Collect(colAllSubtopics, ForAll(Sequence(CountRows(Filter(colTempAllSubtopicsB, TopOrder=9)), 9.1, 0.1), Patch(Last(FirstN(Filter(colTempAllSubtopicsB, TopOrder=9), Value)), {SubTopOrder: RoundUp(Value, 2)})));
 Collect(colAllSubtopics, ForAll(Sequence(CountRows(Filter(colTempAllSubtopicsB, TopOrder=10)), 10.1, 0.1), Patch(Last(FirstN(Filter(colTempAllSubtopicsB, TopOrder=10), Value)), {SubTopOrder: RoundUp(Value, 2)})));

// THIS TRIGGERS THE WORKFLOW
'BSC-PowerApps'.Run(htmlBody_1.HtmlText,varBuildingPhoto,Now(),varBuildingPhotoID,htmlBody_2.HtmlText,htmlBody_3.HtmlText,varItem.ID)

 

Any thoughts as to what is wrong here?

Categories:
I have the same question (0)
  • ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    HI @sudosaurus , For the first issue. When you add a user to security group, the sync of membership of group takes sometime. So, in this after adding a user to security group and please ask user to wait for sometime. If the issue persist, then in that case, ask the user to clear the cache of browser or open in app in inprivate mode.

     

    For 2nd issue, the error clearly says that flow is expecting 6 input parameter and you are passing 7 input parameter and also in PowerApps V2 trigger, I can see there are only 6 input parameter required, then whey you are passing the one extra parameter to flow?

     

    The might be working for you when there was 7 input parameter was required. But I think you made some changes to Flow and now it requires only 6 parameter, so you have remove that one extra parameter.

     

    Also, you have to pass the parameter in same sequence in which it is declared in PowerApps trigger in flow.

     

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,
    ANB

     

     

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @ANB so it looks like Text = varBody is missing as an input - does it matter where this is listed in the below trigger?

    Can I just add it on at the end or does it need to be in order?

    sudosaurus_0-1695995045482.png

     

  • ANB Profile Picture
    7,223 Super User 2025 Season 2 on at

    Hi @sudosaurus , Do you even require that parameter in flow? If yes, then you can add the 7th parameter in PowerApps trigger V2 and then pass from app as last parameter.

     

    ------------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.

    Thanks,
    ANB

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @ANB 

    Having looked at previous flow runs, I can see that parameter in there, although I can't recount whether it was there originally as I don't recall deleting it from the flow myself. 

    {
     "type": "object",
     "properties": {
     "text": {
     "title": "varBody",
     "type": "string",
     "x-ms-dynamically-added": true,
     "description": "Please enter your input",
     "x-ms-content-hint": "TEXT"
     },
     "text_1": {
     "title": "varBuildingPhoto",
     "type": "string",
     "x-ms-dynamically-added": true,
     "description": "Please enter your input",
     "x-ms-content-hint": "TEXT"
     },
     "text_2": {
     "title": "varFileName",
     "type": "string",
     "x-ms-dynamically-added": true,
     "description": "Please enter your input",
     "x-ms-content-hint": "TEXT"
     },
     "number": {
     "title": "varPhotoID",
     "type": "number",
     "x-ms-dynamically-added": true,
     "description": "Please enter a number",
     "x-ms-content-hint": "NUMBER"
     },
     "text_3": {
     "title": "varBody2",
     "type": "string",
     "x-ms-dynamically-added": true,
     "description": "Please enter your input",
     "x-ms-content-hint": "TEXT"
     },
     "text_4": {
     "title": "varBody3",
     "type": "string",
     "x-ms-dynamically-added": true,
     "description": "Please enter your input",
     "x-ms-content-hint": "TEXT"
     },
     "number_1": {
     "title": "varDocDataID",
     "type": "number",
     "x-ms-dynamically-added": true,
     "description": "Please enter a number",
     "x-ms-content-hint": "NUMBER"
     }
     },
     "required": [
     "text",
     "text_1",
     "text_2",
     "number",
     "text_3",
     "text_4",
     "number_1"
     ]
    }

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard