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.
This is the schema of my table:
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.
So after assigning web roles is it still not working?
Please clear cache and try again
What they mention is correct. However, he still cannot find the data.
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:
...
The table of articles contains more than 20 thousand records.
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 %}
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 %}
@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:
I have noticed something in your fetch please move this step at the top and try again
And make sure the url has the query string parameter as pricelist.
Lucas001
60
Super User 2025 Season 1
Fubar
55
Super User 2025 Season 1
surya narayanan
35