Populate SQL from true/false values in editable list

  • 30 January 2021
  • 4 replies
  • 4 views

Hello,

I have an editable list that, when queried, displays the correct true/false from the SQL query.  I’m having a hard time figuring out the steps needed to iterate through each checkbox state and send its value to a SQL stored proc that updates that record.

So far, I’ve tried the conditional for/each loop through list items option, but the form view that contains the results set / editable list items apparently doesn’t contain the type of list item the for/each condition is wanting.

Any suggestions would be greatly appreciated!


4 replies

Hello @ScottRitshie ,

 

Could you please explain your requirement in a bit more detailed way or if possible provide a screenshot of what are you trying to achieve?

 

Are you trying to implement the bulk save in List view?

 

Regards,

Divya Raj

Divya,

Best to explain it visually.  The first screenshot shows the editable list with true/false checkboxes and the second the stored proc that’ll be used to update the records.
 

user_application_id and enabled_ind are passed successfully, but only for 1 record. email is a static value passed and doesn’t come from the form..just used as internal reference.



What I’m trying to figure out is how to iterate through the the records returned, each with its own checkbox, and use the stored proc to check the value and update the boolean field accordingly.  My guess would be for K2 to loop through each record returned, check its value, and call that stored proc.  The current for/each condition in K2 doesn’t seem to support this particular editable list, but maybe I’m missing something.

Thanks for the help!
Scott

Hi Scott,

 

Thanks for the details. Couple of comments here

 

If you want to iterate through the list items you can use the below rules

Condition For Each Item in the List View

I have created an example to show the list items value on click of a button click
 

Also, in the screen shot of your stored procedure, I observer you are just updating the UserApplication table. I am not sure if you have done that for the demo purpose or this is your actual requirement. if yes, you don’t need to create the stored procedure for this and creating a fully functioning editable list view is quite easy in K2 and you can create it just by couple of clicks. You can check the below documentation

https://help.nintex.com/en-US/k2five/userguide/5.4/default.htm#Create/Views/EditableListViews.htm?TocPath=Create%257CSmartForms%257CViews%257CList%2520Views%257C_____3

 

Regards,

Divya Raj

 

Hey Divya,

I realized the best way to do this was to create a new stored proc and just disable all applications for that user, while enabling the one passed.  Your link was very helpful in getting more info on the editable lists.  Bookmark saved… will study up on it. 

Thanks for the help!
Scott

Reply