Allow "Rules" to apply to "Inline Editing"

As a Knack Builder, I would like the same rules that I set up for when a record is edit via a form to be also applied when the record is edit inline on a table so that I can maintain the workflow setup in my app.

Scenario: When a record is updated I have a record rule that emails the administrator about that update. For ease of use I would like to allow the users to edit these records inline in a table, but since that rule to email the administrator isn’t available, I must require the users to edit on a form.

I just happened to be working on this  situation today so I thought I'd post a better example.

For those who want to use an API call to trigger "rules" on an inline edit of a table row since Knack doesn't yet make it easy using the builder.

Hope it helps somebody out!

$(document).on('knack-cell-update.view_XXX', function(event, view, record) { //change to your view

var payment = record.id;
var customer = record.field_234; //You can grab field info from the row you edited in this format.
var customerId = customer.slice(13,37);  //Here, I'm parsing the recordID from the customer 'display' field
var date = record.field_405;
var products = record.field_324;

//Field_324 is a list of connected records. (NOT ACTUALLY PART OF THIS OBJECT)  so......

//The next 5 fields are to parse the html out of the data before repackaging to send in the ajax call.

//There's probably a much better way. But, this is how I did it. I'm not great at parsing.

var prodtext1 = products.slice(36,1000);
var prodtext2= prodtext1.substr(0, prodtext1.indexOf('</span>,'));
var prodtext3= prodtext1.split("\">").pop();
var prodtext4= prodtext3.substr(0, prodtext3.indexOf('</span>'));

//prodtext5 is the formatted as I want it. without html tags.


var prodtext5= prodtext2 + ", " + prodtext4;


var data = {
field_453: customerId, // THIS is a connection field ie record.id
field_452: date,
field_454: payment, // THIS is a connection field ie record.id
field_452: date,
field_450: prodtext5
};

Knack.showSpinner();
// Make the AJAX call
$.ajax({

//url is a hidden form you create to post a record, you could also edit a record by including the recordID in the call
url : 'https://api.knack.com/v1/pages/page_XXX/views/view_XXX/records/', //replace with your scene and view
type: 'POST',
headers: {
'Authorization': Knack.getUserToken(),
'X-Knack-Application-Id': Knack.application_id,
'Content-Type': 'application/json'
},
data: JSON.stringify(data),
}).done(function(responseData) {
console.log('Record updated! ');
Knack.hideSpinner();
});
});

You can trigger your own rules using the listener 'knack-cell-update.' I can post a more detailed example if anyone is interested.


$(document).on('knack-cell-update.view_XXX', function(event, view, record) {
// Do something here

//get record ID

//make ajax call

});

Also want to bump this one, I was going to make a post on the same thing. This would be a really useful feature we'd use in many places in our app login. Some tables get very awkward for users to interface with without this functionality.

I'd list ideas we would want but a lot are already in this thread (going back 2 years!) and basically the idea is that inline editing would benefit a lot from functionality that is available now in form editing

Crickets

 

I would request that the inline editing itself be conditional.  For example, you have a proposal that needs a signature and you want to do this inline, you could have a rule function that allows for inline editing until it is signed and then turns it off.  Right now, it is either on for the entire column or off.  

This should be implemented on database level instead of interface level.

 

Want to also agree with Jonfrm who also mentioned the needed filter option when inline editing, very similar to how you filter by user and connected records on forms.. that would be EXTREMELY helpful for inline editing, and table views in general..


Please see and like this topic created about this related request.. 

http://helpdesk.knackhq.com/support/discussions/topics/5000018980

Def agree with Nicholas, execution of form rules after an inline edit would be awesome. But I would like to second what Michael said as well. Even with rule execution, the inline feature is not safe to use because you cannot apply filters of any kind. A filter option, especially in regards to the selection of connected records when using the inline edit feature would be awesome!

Agreed!  Would love the see the feature added.  Inline editing is great but frustrating to use

This would be a huge positive addition to a few of my apps. Really hoping you guys can add this. 

Definitely agree with this request - inline editing is a great feature that I just can't use because I can't filter the choices.

I would like to second what Jonfrm said about limiting the list in a connection field column during inline editing the same way you can on a form

Similarly when inline editing, you're sometimes dealing with fields that you normally need to add other options (values) to - than those provided in a drop-down list - but can't.  You can, when the same field value is editible within a form though.

One use case for this is when tagging a lot of records in a search result table.  This is best done in the table (search result in my case). The"Edit Column" dialogue box doesn't provide the check box to "allow users to add new values" that currently appears for certain form fields.

It would be really helpful if it did!  Please?

I need this too!  Also, I need to be able to limit the list in a connection field column during inline editing the same way you can on a form (screen shots attached)…

 

[As of August 2020] You can now trigger record rules on tables while inline editing. These rules can update the record being edited, insert a new connected record, update a connected record or send a custom email.

These record rules are similar to form record rules and can be used to do things like track which user last updated a record, send an email when a record is updated or update/insert connected records when a status has changed.

Learn more about this feature here: Using Record Rules - Knack Knowledge Base

I have email alerts set up for form submissions, is there a way to send an email alert when a field is updated inline?

They have not added functionality yet but, would be helpful if we could setup rules for inline editing too.

 

this would be a great add