Home > Forum > Forms > Items list modification

Items list modification
0

Hello everyone. I continue developing my module with apartment reservations and came across another problem. Dictionary contains apartments and parking places (together, as most parameters are common for both types). Some apartments have dedicated parking place (this fact is stored in one of parameters of apartments). When I select an apartment that has dedicated parking place I manage to check and store the ID of the assigned parking place in a technical variable on the fly (as form rule invoked on callback of the items list). However, I can not add it automatically to the list, as there is no function that allows me to do this (or I can not find it).
The only procedure that allows me to change the items list and add rows that were not there is the initialization through sql. But in this case I don't need any initialization at all. Is initialization the only way, or do you manage to cope in such cases in some other way?

MVP

I am not sure that I understand what you need, but I suppose you need to add some rows to an item list at a particular moment, which is not at initialization.

To do that, you can either use the "Change Item list Values" Action on a specific event (At entry in a step, the exit of a step, on a timeout, or on a path), or you can use form rules. The form rules at some point in V2021 added a lot of new item list functions. So you can use all the functions attached in the picture as long as you can figure out when to trigger the specific formula you need.

In reply to: Razvan Ogrezeanu - ENCORSA Romania

I am not sure that I understand what you need, but I suppose you need to add some rows to an item list at a particular moment, which is not at initialization.

To do that, you can either use the "Change Item list Values" Action on a specific event (At entry in a step, the exit of a step, on a timeout, or on a path), or you can use form rules. The form rules at some point in V2021 added a lot of new item list functions. So you can use all the functions attached in the picture as long as you can figure out when to trigger the specific formula you need.

This is exactly what I want to do - change item list but not in the initialization stage.

"Change Item list Values" Action seems to be the thing I could use, but it only works on paths. There are no (unfortunately) functions I could use in form rules. The mentioned "Add new row" does what it sais - adds a blank row. If there was a fuction that would add a new row and populate it with values from SQL... but there isn't. Or meybe it is planned for 2022?

In this case I will just have to make the form be a little less responsive and use paths and actions instead of form rules on the fly.

MVP
In reply to: Michał Ludwiczak

This is exactly what I want to do - change item list but not in the initialization stage.

"Change Item list Values" Action seems to be the thing I could use, but it only works on paths. There are no (unfortunately) functions I could use in form rules. The mentioned "Add new row" does what it sais - adds a blank row. If there was a fuction that would add a new row and populate it with values from SQL... but there isn't. Or meybe it is planned for 2022?

In this case I will just have to make the form be a little less responsive and use paths and actions instead of form rules on the fly.

Hi Michał,

it should work just fine.

I've a similar use case.
An item list is initialized via a query (creating rows and populating Start/End date) using multiple values from the form. (1)
The initialization is executed via form rule and afterwards notice period is set. The value is calculated via a Business rule using the end date of the row and other fields. (2)
In addition the reminder date is calculated using the calculated notice period stored in another field. (3)

All these values are update when a depending field value changes and everything works without saving the instance. :)

So the major difference is, that I don't add rows. Maybe you can identify the "new row" added via "Add new row" in the "for each row" to set the fields. Either with a form rule or a business rule, which executes SQL.

Best regards,
Daniel