Hello,
I am quite new to Power apps, and I would like to ask if is there a way to enable/disable the Create button on the Entity List based on the values on another form?
Basically, I have a form that is not completely filled up and an Entity List that the Create new record is enabled. The form and the list comes from 2 different tables. The requirement is that the Create button should be disabled when the Entity form is not completely filled up and it will be enabled once the user filled up the form.
My bad, I think it's missing the .each loop in my code above (that's what happens when you don't test it 😅).
data-attribute is the schema name of your column in dataverse, i.e.: name, new_customcolumn, cre88_myothercustomcolumn, etc
tr is basically the element from the loop, updated code bellow (without testing again, hope it helps).
var list = $(".entitylist.entity-grid").eq(0);
list.on("loaded", function () {
var addButton = $(list).find("div.toolbar-actions >> a.btn-primary.create-action");
// empty list
if (list.find("table tbody > tr").length == 0) {
addButton.show();
} else {
list.find("table tbody > tr").each(function (index, tr) {
var statusOfApplication = $(tr).find('td[data-attribute="STATUS OR ANY OTHER FIELD"]').attr("data-value");
if (statusOfApplication == "XXXX") {
addButton.hide();
// probably break the loop / return here;
}
else {
addButton.show();
}
});
}
});
Hello, thank you for the answer.
For the $(tr), where does that come from and for the data-attribute is that the id of the inputs in the form?
Hi, I was working on a very similar requirement yesterday, here is a sample code for you to get started. Please let us know how you go:
var list = $(".entitylist.entity-grid").eq(0);
list.on("loaded", function () {
var addButton = $(list).find("div.toolbar-actions >> a.btn-primary.create-action");
// empty list
if (list.find("table tbody > tr").length == 0) {
addButton.show();
} else {
var statusOfApplication = $(tr).find('td[data-attribute="STATUS OR ANY OTHER FIELD"]').attr("data-value");
if (statusOfApplication == "XXXX") {
addButton.hide();
// probably break the loop / return here;
}
else {
addButton.show();
}
}
});
Fubar
69
Super User 2025 Season 1
oliver.rodrigues
49
Most Valuable Professional
Jon Unzueta
43