cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chris2k_
New Member

Confusing paremeters with comma or semicolon

Hi Folks,

I'm new in PowerApps and play with custom API connector, for load and save data.

The Problem:

Examples which _not_ work:
ClearCollect(Employees, SampleApi.SaveEmployee({name:Label1.Text,name:Label2.Text}))
ClearCollect(Employees; SampleApi.SaveEmployee({name:Label1.Text,name:Label2.Text}))
ClearCollect(Employees; SampleApi.SaveEmployee({name:Label1.Text;name:Label2.Text}))
ClearCollect(Employees, SampleApi.SaveEmployee())

Error Message: Invalid number of Arguments. Received 1, need 2


Example which work:

ClearCollect(Employees; SampleApi.LoadEmployee())

 

What i need is simple post to api which require 2 parameters, but there is no way to this, because parameter seperator (,) not accepted?

😕

Any Idea?

1 REPLY 1
iAm_ManCat
Super User
Super User

Hi @chris2k_ 

 

It looks like you have wrapped your response into a single record/argument by wrapping the outers with { }

 

Currently you have:

ClearCollect(
   Employees, 
   SampleApi.SaveEmployee(
   {
      name:Label1.Text,
      name:Label2.Text
   }
   )
)

 

But that means in one record you have two params called name, so instead you should probably separate those into separate record/arguments to be sent to the flow:

ClearCollect(
   Employees, 
   SampleApi.SaveEmployee(
   {
      name:Label1.Text
   },
   {
      name:Label2.Text
   }
   )
)

 

Cheers,

@iAm_ManCat


Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (4,228)