cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JimHawkins
Level: Power Up

Unexpected characters and Invalid number of arguments on combobox that works fine

I have a combobox with the following code for items:

Combobox_CTC_4.Items=

Filter(
    Sort(_ChargeTypes, ChargeTypeCode),
    ChargeGroupCode = First(ComboBox_CGC.SelectedItems).Result
)

_ChargeTypes is a collection that looks something like this:

Spoiler
Capture13.PNG


The items in Combobox_CTC_4 are filtered so their ChargeGroupCode matches the ChargeGroupCode picked in another combobox (Combobox_CGC).

 

I get 2 errors on Combobox_CTC_4:

  • Unexpected characters. The formula contains 'ParenClose' where 'Eof' is expected.
    Location: Combobox_CTC_4.SearchItems
  • Invalid number of arguments: received 1, expected 3 or more. 
    Location: Combobox_CTC_4.SearchItems

The weird thing is, the combobox functions properly. I still get the little red error icon next to the combobox, but I go into the code and there are no red underlines anywhere.

I've tried saving and restarting the studio but it still remains...

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Unexpected characters and Invalid number of arguments on combobox that works fine

There are few things I am not placing but one thing I know right off is your order is off. Sort goes before Filter and also I don't see where you are telling it what to sort by and Ascending or Descending either.

 

It goes like this:

 

Sort(Filter(DataSoure, Column1="FilterInfo"),"ColumnSortedBy",Ascending)

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Unexpected characters and Invalid number of arguments on combobox that works fine

There are few things I am not placing but one thing I know right off is your order is off. Sort goes before Filter and also I don't see where you are telling it what to sort by and Ascending or Descending either.

 

It goes like this:

 

Sort(Filter(DataSoure, Column1="FilterInfo"),"ColumnSortedBy",Ascending)

View solution in original post

Super User
Super User

Re: Unexpected characters and Invalid number of arguments on combobox that works fine

What is the formula for the Items property of ComboBox_CGC?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
JimHawkins
Level: Power Up

Re: Unexpected characters and Invalid number of arguments on combobox that works fine

Thank you @rebeccas, switching the order of Sort and Filter fixed it. 

P.S.
I was sorting the collection _ChargeTypes by the column ChargeTypeCode. Also, I left out Ascending/Descending because it defaults to Ascending.

New Code:

Sort(
    Filter(_ChargeTypes, ChargeGroupCode = First(ComboBox_CGC.SelectedItems).Result),
    ChargeTypeCode
)

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 79 members 3,774 guests
Please welcome our newest community members: