Setting a dynamic list row within a dynamic list container

Hello,

I’m trying to build functionality where a user is offered checkboxes for each employment they have had, and then if they select this employment they are offered checkboxes for each year they were employed.

To achieve this I am trying to use a dynamic list container to offer all employments, and this is working:

The first checkbox has data binding to the relevant database column and is linked with this on page enter logic:

This shows this on the app:

image

The second row is not working. I would like it to be displayed when an employer name is checked, and to repeat all available years based on the database entries. So a user worked for Acme Ltd in 2021 and 2020, then it will display both of these options as checkboxes.

I have set the row to not be displayed by default and given it dynamic list behaviour:

The row is set to display using the on change event logic on the first checkbox:

The dynamic list items in the row are set in on page enter logic as well:

But when this is selected on the app, the row opens but no text is displayed:

image

I know the on page enter logic is working, because if I use a new container for it, it displays both years as intended.

Is it possible to have a dynamic list row inside a dynamic list container, and if so, what I am doing wrong so that it doesn’t display the data?

Also, you will see here that I have entered the actual objectId in the where clause for testing purposes, but eventually this will need to take the objectId from the previous dynamic list object to make sure the years correspond to the correct employer. How do I do this?

Thanks,
Luc

Hello @Luc_Zentar

Is it possible to have a dynamic list row inside a dynamic list container, and if so, what I am doing wrong so that it doesn’t display the data?

It’s possible.
Dynamic list in the dynamic list would be a great solution for rendering recursive data but in your case the second list of years does not refer to employment directly, right? (i see years were saved in another table).

If yes, you should use Dynamic Items Logic handler for the year’s dynamic list.

Also if it is possible, load years one time, store it to Page Data, and after that get this data from Page Data in Dynamic Items Logic handler.

Regards, Dima.

Hi Dima,

Thank you, it’s good to know it is possible!

Is this what you mean for the dynamic items logic?

It is still producing the same result on the app, the years are not showing.

I am unsure what you mean by loading the years to page data, could you expand on that?

Thanks,
Luc

No, this handler should return a list of data, that has been rendered.

Also, as I said earlier, you can load years only one time, and set them to Page Data, it prevents multiple API requests from Dynamic Items Logic, coz this handler calls every rerender of List Component.

Provide please the container and page name, I will try to find the issue.

Thanks Dima - container is frontEnd and page name is PastYearClaim

I can’t enter this page. Could you reproduce this issue on a separate page or provide me a test user(without any sensetive data) for this purpose?

email to log in

dimatest@mina.group

password

TESTpass

I have set up the data for you, please let me know if it doesn’t work

Could you clarify if everything works fine now? There are be some problems with one of the handlers, but now I fix them.

Hi Dima,

It nearly works but does not return the years dynamically for each employer, instead it always shows the same 2 years. I think this is because we use the actual objectId of one of the employers in the page data setting:

But here I have tried to use the dynamic id in the dynamic items logic

Yeah, sorry. I thought years are always the same.

If years are dynamic, I think you could move Load Table Objects to return(second pic), and remove logic with Page Data(first pic).

I hope we have solved all your issues.

Regards, Dima.

Sorry Dima, it is not working.

I have followed your instruction:

And it now doesn’t show the years

image

Check now, please.

You should use blocks like this:
image

Here is a wrong notation: image

Thank you Dima!