Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Answered

Custom search on PowerApps portals

(0) ShareShare
ReportReport
Posted on by 312

Hi Community,

I am having the following problem: At the time of injection in the URL “?value=1-001 DOLARES”, it is not showing me any data.

MartinVargas_0-1640995380902.png

This is the schema of my table:

MartinVargas_1-1640995380906.png

 

And this is my Custom Javascript;

 

 

{% fetchxml articles %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
 <entity name="crd4f_articles">
 <attribute name="crd4f_elementslistspricieid"/>
 <attribute name="crd4f_idelement"/>
<attribute name="crd4f_ idlistprice"/>
 <attribute name="crd4f_description"/>
<attribute name="crd4f_price"/>
 <filter type="and">
 <condition attribute="crd4f_ idlistprice" operator="eq" value="{{request.params['value']}}" />
 </filter>
 </entity>
</fetch>
{% endfetchxml %}
{% if articles.results.entities.size > 0 %}{
 "results":
 [
 {% for article in articles.results.entities %}
 {
 "Id": "{{article.crd4f_elementslistspricieid}}",
 "Element": "{{article.crd4f_idelement}}",
 "Description": "{{article.crd4f_description}}"
 }
 {% unless forloop.last %},{% endunless %}
 {% endfor %}
 ]
}
{% else %}
 No data found.
{% endif %}

 

 

 

It should be noted that this table has more than 20,000 records.

 

Can you help me here?

 

I would appreciate it Guys.

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Custom search on PowerApps portals

    @ragavanrajan 

    Can you please have a look on this one?

     

  • MartinVargas Profile Picture
    312 on at
    Re: Custom search on PowerApps portals

    @Mira_Ghaly.

    Still not working, also delete the cache.

     

    MartinVargas_0-1641337391175.png

     

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Custom search on PowerApps portals

    @MartinVargas 

    So after assigning web roles is it still not working? 

    Please clear cache and try again

  • MartinVargas Profile Picture
    312 on at
    Re: Custom search on PowerApps portals

    @Mira_Ghaly 

    If I have assigned web roles for Administrators and Authenticated Users.

     

    MartinVargas_0-1641335574878.png

     

     

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Custom search on PowerApps portals

    @MartinVargas 

     

    Have you assigned a web role to the table permission?

     

  • MartinVargas Profile Picture
    312 on at
    Re: Custom search on PowerApps portals

    @Mira_Ghaly  @Soundharya 

    What they mention is correct. However, he still cannot find the data.

    MartinVargas_0-1641332618783.png

    This is the part of the code:

     

     

    {% assign pricelist = request.params.pricelist %}
    {% fetchxml articles %}
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
     <entity name="crd4f_articles">
     <attribute name="crd4f_elementslistspricieid"/>
     <attribute name="crd4f_idelement"/>
    <attribute name="crd4f_ idlistprice"/>
     <attribute name="crd4f_description"/>
    <attribute name="crd4f_price"/>
     <filter type="and">
     <condition attribute="crd4f_ idlistprice" operator="eq" value="{{pricelist}}" />
     </filter>
     </entity>
    </fetch>
    {% endfetchxml %}
    {% if articles.results.entities.size > 0 %}{
     "results":
     [
     {% for result in articles.results.entities %}
     {
     "Id": "{{pricelist.crd4f_elementslistspricieid}}",
     "Element": "{{pricelist.crd4f_idelement}}",
     "Description": "{{pricelist.crd4f_description}}"
     }
     {% unless forloop.last %},{% endunless %}
     {% endfor %}
     ]
    }
    {% else %}
     No data found.
    {% endif %}

     

     

    To be exact, these are some of the data that I want to show:

    MartinVargas_1-1641333007785.png

    ...

    The table of articles contains more than 20 thousand records.

     

     

  • Verified answer
    soundharya Profile Picture
    249 on at
    Re: Custom search on PowerApps portals

    Try below

    you have missed for loop {% for result in articles.results.entities %} line

    {% assign pricelist = request.params.pricelist %}
    {% fetchxml articles %}
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
     <entity name="crd4f_articles">
     <attribute name="crd4f_elementslistspricieid"/>
     <attribute name="crd4f_idelement"/>
    <attribute name="crd4f_ idlistprice"/>
     <attribute name="crd4f_description"/>
    <attribute name="crd4f_price"/>
     <filter type="and">
     <condition attribute="crd4f_ idlistprice" operator="eq" value="{{pricelist}}" />
     </filter>
     </entity>
    </fetch>
    {% endfetchxml %}
    {% if articles.results.entities.size > 0 %}{
     "results":
     [
     {% for result in articles.results.entities %}
     {
     "Id": "{{pricelist.crd4f_elementslistspricieid}}",
     "Element": "{{pricelist.crd4f_idelement}}",
     "Description": "{{pricelist.crd4f_description}}"
     }
     {% unless forloop.last %},{% endunless %}
     {% endfor %}
     ]
    }
    {% else %}
     No data found.
    {% endif %}

     

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Custom search on PowerApps portals

    @MartinVargas 

    Please try it again and structure as below:

    {% assign pricelist = request.params.pricelist %}
    {% fetchxml articles %}
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
     <entity name="crd4f_articles">
     <attribute name="crd4f_elementslistspricieid"/>
     <attribute name="crd4f_idelement"/>
    <attribute name="crd4f_ idlistprice"/>
     <attribute name="crd4f_description"/>
    <attribute name="crd4f_price"/>
     <filter type="and">
     <condition attribute="crd4f_ idlistprice" operator="eq" value="{{pricelist}}" />
     </filter>
     </entity>
    </fetch>
    {% endfetchxml %}
    {% if articles.results.entities.size > 0 %}{
     "results":
     [
     {
     "Id": "{{pricelist.crd4f_elementslistspricieid}}",
     "Element": "{{pricelist.crd4f_idelement}}",
     "Description": "{{pricelist.crd4f_description}}"
     }
     {% unless forloop.last %},{% endunless %}
     {% endfor %}
     ]
    }
    {% else %}
     No data found.
    {% endif %}

     

  • MartinVargas Profile Picture
    312 on at
    Re: Custom search on PowerApps portals

    @Mira_Ghaly I have a problem implementing it as you mention, my code is as follows:

     

    {% assign pricelist = request.params.pricelist %}
     "results":
     
     "Id": "{{pricelist.crd4f_mkt_elementslistpricieid}}",
     "Element": "{{pricelist.crd4f_id_element}}",
     "Description": "{{pricelist.crd4f_description}}"
     
     
    
    {% fetchxml articles %}
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
     <entity name="crd4f_articles">
     <attribute name="crd4f_mkt_elementslistpricieid"/>
     <attribute name="crd4f_id_element"/>
     <attribute name="crd4f_idlistprice"/>
     <attribute name="crd4f_description"/>
     <attribute name="crd4f_price"/>
     <filter type="and">
     <condition attribute="cr4ef_idlistprice" operator="eq" value="{{pricelist}}" />
     </filter>
     </entity>
    </fetch>
    {% endfetchxml %}

     

    At the time of testing it, it does not show me any data:

     

    MartinVargas_2-1641251510438.png

     

     

     

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Custom search on PowerApps portals

    @MartinVargas 

    I have noticed something in your fetch please move this step at the top and try again

    Mira_Ghaly_0-1641250050854.png

    And make sure the url has the query string parameter as pricelist.

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35