cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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
Highlighted
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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 387 members 5,177 guests
Please welcome our newest community members: