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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Custom search on Power...
Power Pages
Unanswered

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.

Categories:
I have the same question (0)
  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @MartinVargas 

    Try to do as below to get the pricelistid

    {% assign pricelist = request.params.value %}

     and in the fetch:

    {% 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 %}

     

  • MartinVargas Profile Picture
    312 on at

    Hi @Mira_Ghaly. Try to do it as you mention. I just don't know if I implement it the right way.

     

    This is part of the fetchxml:

     

    {% fetchxml articles %}
    {% assign pricelist = request.params.value %}
    <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>

     

     

    When testing it I get the following error:

     

    MartinVargas_0-1641178666639.png

     

    Can you tell me what I'm doing wrong?

    Regards.

  • soundharya Profile Picture
    249 on at

    Hi,

     

    In the URL you still need to pass parameter as value only (?value=1-001 DOLARES) and also define assign variable outside fetchxml

     

    {% assign pricelist = request.params.value %}
    {% 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 %}

    Also make sure, the data is available for the given value (1-001 DOLARES)

  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    Hi @MartinVargas

    Just replace value with the name in your query string 

    {% assign pricelist = request.params.pricelist %}


     

     

  • MartinVargas Profile Picture
    312 on at

    Hi @Mira_Ghaly and @Soundharya , the fetch code and query look like this:

     

     

     

    {% 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 %}{
    {% assign pricelist = request.params.pricelist %} 
     "results":
     [
     {
     "Id": "{{pricelist.crd4f_elementslistspricieid}}",
     "Element": "{{pricelist.crd4f_idelement}}",
     "Description": "{{pricelist.crd4f_description}}"
     }
     {% unless forloop.last %},{% endunless %}
     {% endfor %}
     ]
    }
    {% else %}
     No data found.
    {% endif %}

     

     

     

     

     

    While testing this fetch, it still doesn't show me data:

    MartinVargas_0-1641245900548.png

     

     

     

  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @MartinVargas 

    I am confused from screenshots sometimes the query url has Value and sometimes has pricelist which one you are using?

    Mira_Ghaly_0-1641247473752.png

    Mira_Ghaly_1-1641247529375.png

    So which one you are using and which one do you use in the assign?

     

     

     

  • MartinVargas Profile Picture
    312 on at

    @Mira_Ghaly 

    As @Soundharya  showed me, I try to display the data with the value (?Value=1-001 DOLLARS). That is why I did that test.

  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @MartinVargas 

    I want to check if you had added Table permissions to the entity 

    crd4f_articles

    Can you please check that?

     

  • MartinVargas Profile Picture
    312 on at

    @Mira_Ghaly , sure!

     

    MartinVargas_0-1641249459464.png

     

  • Mira Ghaly Profile Picture
    11,413 Moderator on at

    @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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard