cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SAMUELAL
Resolver I
Resolver I

Where is the unexpected Character?

I am getting the error that characters are used in an unexpected way.

 

"For example, the character '\' isn't expected after a number, like this: '32\'. A space ('32') would be expected so that it's just the number 32 or another number (as in '323') would be expected.

 

Filter('HSS Picksheet020521Z', StartsWith(Title,ResourceDropDown.SelectedText.Value)), If(IsBlank(SerialSearchBox.Text),Filter('HSS Picksheet020521Z','Serial Number'=V1),Filter('HSS Picksheet020521Z',StartsWith('Serial Number', SerialSearchBox.Text)))

1 ACCEPTED SOLUTION

Accepted Solutions
SAMUELAL
Resolver I
Resolver I

This is what ended up working:

 

<Filter('HSS Picksheet (6)', And(Title = ResourceDropDown.Selected.Result), StartsWith('Serial Number',SerialSearchBox.Text))>

View solution in original post

14 REPLIES 14
JR-BejeweledOne
Super User
Super User

Please share a screenshot of this formula with the red lines and error.   That message can be confusing and doesn't necessarily refer to a character that shouldn't be there.

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

SAMUELAL_0-1612792998489.png

The red line only appears under the comma (I drew it in because it goes away when you click away from the screen)

Drrickryp
Super User
Super User

@SAMUELAL 

.SelectedText is deprecated try .Selected.Value

JR-BejeweledOne
Super User
Super User

Try reconstructing your filter statement something like this:

 

If(
IsBlank(SerialSearchBox.Text),Filter('HSS Picksheet020521Z','Serial Number'=V1),
!IsBlank(ResourceDropdown.SelectedText.Value), Filter('HSS Picksheet020521Z', StartsWith(Title,ResourceDropDown.SelectedText.Value))
Filter('HSS Picksheet020521Z',StartsWith('Serial Number', SerialSearchBox.Text))

)

 

Currently where the comma is it's expecting ';'.  



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

How do I fix this?

 

Edit: this was meant to be a response to another post

JR-BejeweledOne
Super User
Super User

Did you see my previous answer?   Your filter statement needs to be reconstructed.    I gave you an example based on what you have now.

 

Let me ask this.

 

Here is what I see in your filter statement.   You want it to filter by the value of the Resource dropdown or by the search box value.  If the searchbox is blank it will automatically filter by the value V1.

 

Try this:

 

If(

!Isblank(SerialSearchBox.Text, Filter('HSS Picksheet020521Z', StartsWith('Serial Number', SerialSearchBox.Text) Or StartsWith(Title, ResourceDropDown.SelectedText.Value),

IsBlank(SerialSearchBox.Text), Filter('HSS Picksheet020521Z', 'Serial Number' = "V1")

 

)



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

My apologies: 

My comment "How do I fix this?" was intended for another post.

 

My intention is that my data table is filtered by a 'Resource' (the drop down) AND filtered by a 'serial number'. I want the user to have the option to scan a barcode of the 'serial number' OR type in the serial number if a barcode is not available.

JR-BejeweledOne
Super User
Super User

 

Ok, you will still need to reconstruct your filter statement.   It's not going to to work the way you have it.   The whole filter statement needs to be in within the If(), to work properly.

 

Try it this way.

 

If(

!Isblank(SerialSearchBox.Text And !IsBlank(SerialSearchBox), Filter('HSS Picksheet020521Z', StartsWith('Serial Number', SerialSearchBox.Text) And StartsWith(Title, ResourceDropDown.SelectedText.Value),

IsBlank(SerialSearchBox.Text), Filter('HSS Picksheet020521Z', 'Serial Number' = "V1")

 

)



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

There are some things that need debugging in the formula you provided. I am assuming that fixing errors at the top of the formula checker will resolve the ones on the bottom of the list.

 

Here is the first one:

SAMUELAL_0-1612796943046.png

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,053)