Hello community, I am working with a portal in power apps.
I am trying to filter the list shown to the right, based on the text entered in the "Title" field of my form. In a certain way I want to filter the "Keywords" list by what is entered in the "Title" field.
This is the javascript that I have implemented
function onPrimaryChange(){
// get id of selected primary field
// this will work only if you render primary field as dropdown
let primaryValue = $("#title").val();
var list = $(".entity-grid");
if(primaryValue != null && primaryValue !=""){
console.log("titulo:" + primaryValue);
list.find("table tbody > tr").each(function () {
var tr = $(this);
//var adminOnly = $(tr).find('td[data-attribute="title"]').attr("aria-label");
var adminOnly = $(tr).find('td[data-attribute="title"]').attr("data-value");
//console.log("prueba1: " + adminOnly);
if (!adminOnly.includes(primaryValue)){
tr.hide();
list.show();
}
else
{
tr.show();
list.hide();
}
});
}else if(primaryValue == null || primaryValue =="")
{
list.hide();
}
}
Any ideas?
@OliverRodrigues
Can someone help me here?
Thanks cheers.
Hi, are you using a complete custom JavaScript filter? or the OOB filters?
I feel like the OOB should cover your requirement, see if this article helps: Entity List filters for Power Apps Portals - Ulrikke Akerbæk (akerbak.com)
Power Pages Super User | MVP
Hi @OliverRodrigues , I am using a custom filter in javascript and a form. My situation is that when entering information in a field of my form, I should filter my list if any word entered matches the field of the form.
Greetings.
a few more questions:
Power Pages Super User | MVP
-Is your list a subgrid or a list?
It's a list of a table I have in dataverse.
-Does the filter have to happen while writing?
It is correct, the filter must be executed when the value entered by the user changes, in this case in the title field.
-What is the business requirement for this?
The commercial requirement is that our clients can raise tickets through our page, at this moment I am working on the form filling section and when the client enters his problem in the title section, our list should show the knowledge articles that match the keywords entered by the client so that the client has the opportunity to self-serve and if possible can solve their problems through these articles.
Ready friend!
Thanks for the info, this feature is actually OOB from Power Apps Portals with case management:
Configure and manage category for knowledge articles - Power Apps | Microsoft Learn
hope this helps
Power Pages Super User | MVP