web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search error: no resul...
Power Apps
Unanswered

Search error: no result if search input to long

(0) ShareShare
ReportReport
Posted on by 13

Hello,

 

I try to implement a search with the formula: 

SortByColumns(Search(EntityName, TextSearchBox1.Text, "GUID"), "GUID", If(SortListVAR, Descending, Ascending))

 

Now if I use the search to look for a GUID i get the correct result when I enter

image.png

 

But as you can see there is the last number missing. If I enter the whole GUID now the search doesn`t show me the result

 

 

image.png

I tried changing the max. length of the input field but it doesn`t change the outcome. Also the length of the GUID field in the entity is set correctly.

 

I also want to prevent the search from working if not a whole GUID is entered in the correct format.

 

Thank you in advance.

 

 

 

 

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @DanK,

     

    Could you please share a bit more about the Entity that you mentioned? Is it a CDS entity?

    Which type of the GUID field within your Entity?

     

    I have made a test on my side (generate an app from CDS entity) and don't have the issue that you mentioned. The GIF image as below:Test1.gif

     

     

    Please check if the Max length property of the GUID field within your Entity is set to a proper value which is more than the length of the GUID field value.

     

    Please take a try to generate an app from your Entity or re-create your app, then check if the issue is solved. More details about generating an app from Common data service, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/data-platform-create-app

     

    In addition, if you want to prevent the search from working if not a whole GUID is entered in the correct format, please take a try with the following workaround:

     

    Set the Items property of the Gallery control to following formula:

    If(
    !IsBlank(TextSearchBox1.Text),
    SortByColumns(Filter(ProductsRecord,StartsWith(TextSearchBox1.Text,GUID),Len(TextSearchBox1.Text)=36), "GUID", If(SortDescending1, Descending, Ascending)),
    ProductsRecord
    )

    Note: The 36 represents the length of the GUID field value within your Entity.

     

    The GIF image as below:Test1.gif

     

     

     

     

    Best regards,

    Kris

  • DanK Profile Picture
    13 on at

    Hello @v-xida-msft

    first and foremost thank you for your help and response.

     

    I got it working with your formular and the filter function. To confirm that it is a GUID I use a regex.

    If(IsMatch(TextSearchBox1.Text,"^[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}$"),
    SortByColumns(Filter(TABLE, StartsWith(TextSearchBox1.Text,guid)),"guid",If(SortListVAR,Descending,Ascending)),SortByColumns(TABLE, TextSearchBox1.Text, "primaryname"), "primaryname", If(SortListVAR, Descending, Ascending)))

    With this I search for a GUID in the "subtitle" or a normal name in the main title.

     

    So as this is working I get a "delegation error" because of the StartsWith function.
    It says "Part of this formula cannot be evaluated remotely. the 'StartsWith' function cannot be delegated if a field name appears in the second argument." 

    Also this.

     image.png

    Regardig it I read: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

     

    Is there an alternative for the StartsWith function in this matter?

     

    Also the error I described existed only on the Search function

    SortByColumns(Search(TABLE,TextSearchBox1.Text,"guid"), "guid",If(SortListVAR, Descending, Ascending))

    It had no impact changing the length of the field value. Also it is a CDS entity in the Production environment not the Trial.

    If I use this code I also get the message:

    image.png

     

    So all in all thank you it works for now so far 😃 But I might get into trouble with larger data sets.

     

  • DanK Profile Picture
    13 on at

    Hello @v-xida-msft

    first and foremost thank you for your help and response.

     

    I got it working with your formular and the filter function. To confirm that it is a GUID I use a regex.

    If(IsMatch(TextSearchBox1.Text,"^[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}$"),
    SortByColumns(Filter(TABLE, StartsWith(TextSearchBox1.Text,guid)),"guid",If(SortListVAR,Descending,Ascending)),SortByColumns(TABLE, TextSearchBox1.Text, "primaryname"), "primaryname", If(SortListVAR, Descending, Ascending)))

    With this I search for a GUID in the "subtitle" or a normal name in the main title.

     

    So as this is working I get a "delegation error" because of the StartsWith function.
    It says "Part of this formula cannot be evaluated remotely. the 'StartsWith' function cannot be delegated if a field name appears in the second argument." 

    Also this.

     image.png

    Regardig it I read: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

     

    Is there an alternative for the StartsWith function in this matter?

     

    Also the error I described existed only on the Search function

    SortByColumns(Search(TABLE,TextSearchBox1.Text,"guid"), "guid",If(SortListVAR, Descending, Ascending))

    It had no impact changing the length of the field value. Also it is a CDS entity in the Production environment not the Trial.

    If I use this code I also get the message:

    image.png

     

    So all in all thank you it works for now so far 😃 But I might get into trouble with larger data sets.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard