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 / Error adding data thro...
Power Apps
Unanswered

Error adding data through search filtering

(0) ShareShare
ReportReport
Posted on by 312

Hi community, I managed to implement the following article in my portal: https://www.dancingwithcrm.com/custom-lookup-filtering-powerapps-portal/

 

This is the liquid template that returns the results in JSON format:

{% assign pricelist = request.params.pricelist %}
{% fetchxml articulos %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" >
 <entity name="crd4f_mkt_elementoslistaprecios">
 <attribute name="crd4f_mkt_elementoslistapreciosid"/>
 <attribute name="crd4f_idelemento"/>
 <attribute name="crd4f_idarticulo"/>
 <attribute name="crd4f_idlistaprecios"/>
 <attribute name="crd4f_descripcion"/>
 <attribute name="crd4f_precio"/>
 <filter type="and">
 <condition attribute="crd4f_idlistaprecios" operator="eq" value="{{pricelist}}" />
 </filter>
 </entity>
</fetch>
{% endfetchxml %}
{% if articulos.results.entities.size > 0 %}{
 "results":
 [ 
 {% for articulo in articulos.results.entities %}
 {
 "Id": "{{articulo.crd4f_mkt_elementoslistapreciosid}}",
 "Elemento": "{{articulo.crd4f_idelemento}}",
 "Articulo": "{{articulo.crd4f_idarticulo}}",
 "Descripcion": "{{articulo.crd4f_descripcion}}",
 "Lista_precio": "{{articulo.crd4f_idlistaprecios}}",
 "Precio": "{{articulo.crd4f_precio}}"
 }
 {% unless forloop.last %},{% endunless %}
 {% endfor %}
 ]
}
{% else %}
 No data found.
{% endif %}

 

And this is the JavaScript that the form has:

$(document).ready(function () {
 
 var listprice = "{{user.crd4f_listaprecios}}";
 console.log("ListPrice " + listprice);
 
 // remove all option from dependent field
 $("#crd4f_clavearticuo").empty();

 if(listprice != null && listprice !=""){
 // request to our custom page with id as parameter
 $.getJSON("/pedido/json-articles/?pricelist="+listprice, function(data) {
 if(data.results.length>0){
 //create option for each returned entity
 data.results.forEach(element => {
 let option = document.createElement("option");
 option.value = element.Id;
 option.innerText = element.Descripcion;
 console.log(option);
 $("#crd4f_clavearticuo").append(option); 
 
 });
 } 
 }
 );
 }
 }); 

 

At the time of sending the data of this form and with its respective quantity and selected article key,

MartinVargas_0-1642115312947.png

it throws me the following error:

MartinVargas_1-1642115318409.png

 

Sorry, an error appears to have occurred. He try again. If the problem continues, contact the website administrator.

ID no. error [7283f720-3007-4540-b5b4-e161e3791a56]

We have been notified of this issue and will discuss it shortly. Thank you for your patience.

01/12/2022 23:44:13 UTC

NAM 920e9d2f-d95f-4f84-ae18-f4d406f75452

 

It's funny, because sometimes this form is sent correctly.

 

Can you help me here?

I would appreciate it Guys.

Categories:
I have the same question (0)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard