cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MShelnutt
Helper IV
Helper IV

My Code is throwing errors

Hi,

I am getting errors, and not sure why-

Search(
Filter(
'Customer Complaints 21',
IsBlank(StatusBox.SelectedItems.Value) || IsEmpty(StatusBox.SelectedItems) || 'Form Status'= StatusBox.SelectedItems, 'Customer Name', NameFilter.Text))

 

MShelnutt_0-1615910162209.png

 

The Customer Name field error say- ThisItem.CustomerName isn't valid, the identifier isn't recognized.

The RMA# field error says- ThisItem.RMA_x0020_Number isn't valid, the identifier isn't recognized.

The CC# field error says- ThisItem.ID isn't valid, the identifier isn't recognized.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@MShelnutt 

As mentioned in prior response, if it is a choice column you need to add the Value column to it:

Search(
    Filter('Customer Complaints 21',
        IsBlank(StatusBox.SelectedItems.Value) || 'Form Status'.Value in StatusBox.SelectedItems.Value
    ),
    NameFilter.Text, "Customer Name"
)

 

The next question (if that does not work properly) - how is the choice column defined in your List?  Is it single or multi-value?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

10 REPLIES 10
Elias-V
Advocate I
Advocate I

If you click on the red X and select Edit formula you can find a red underlined part of the formula, hovering over that should give you more information about the errors.

RandyHayes
Super User III
Super User III

@MShelnutt 

You have a syntax error in your formula.

Should be:

Search(
    Filter('Customer Complaints 21',
        IsBlank(StatusBox.SelectedItems.Value) || 'Form Status' in StatusBox.SelectedItems.Value
    ),
    NameFilter.Text, "Customer Name"
)

1) You don't need the double IsBlank and IsEmpty, one is sufficient.

2) If 'Form Status' is a text column in your datasource, then it will never compare to a table as you had it.  If it is a choice column in your data source, then change the above to have 'Form Status'.Value instead

3) Search expects a table, a text value and then a list of columns to search.  You had that backward and you had it all in the Filter function instead.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes, it still doesnt like that-

MShelnutt_0-1615912647882.png

 

 

Perhaps it could be useful to include the error, like this:

Elias-V_0-1615913294880.png

Elias-V_1-1615913317698.png

 

@MShelnutt 

What kind of column is 'Form Status' in your datasource?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes  it is a Choice column.

RandyHayes
Super User III
Super User III

@MShelnutt 

As mentioned in prior response, if it is a choice column you need to add the Value column to it:

Search(
    Filter('Customer Complaints 21',
        IsBlank(StatusBox.SelectedItems.Value) || 'Form Status'.Value in StatusBox.SelectedItems.Value
    ),
    NameFilter.Text, "Customer Name"
)

 

The next question (if that does not work properly) - how is the choice column defined in your List?  Is it single or multi-value?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

@RandyHayes  

That worked.  However, now my Filter by Customer, Filter by RMA# and Filter by CC# are not working. 

The CC# is the ID of the SharePoint source.

 

 

 

RandyHayes
Super User III
Super User III

@MShelnutt 

Well you never had those in your formula to begin with.  

Can you explain more about how you think you are setting the ID to a CC#?  

 

As for the fields you want to filter and search on, you need to add those to your formula as they were not there before.

If you're having problems with that, then I would need to know the controls on your screen that will be used as part of the filtering and the types of those controls.  And the fields in your list that correspond and the types of those fields.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (46,599)