How to update a Dynamic List with page data

Hi, I wanted to learn how to update a list with page data.
I want a user to use the select form below to add participants to an application.
When they click the add participant, I wanted to add the user information on the right where there is a list of added participants.

So far my logic is as follows,
On page enter I initialize the participants list by creating an empty list

On Clicking the Add participant button, I update the Page data with the users objectId.

On the repeater logic I load users where (objectId IN '[Get 'participants' of 'Page Data']')

Hi @Breldan_Muthaka

I can see two problems here

  1. when you compose a whereClause you just connect a list, but instead, you need to join it with “,”, you can print the whereClause before passing it to the Load Objects block

  2. you load data in the “Repeater Data Logic”, and this is a bad practice because this kind of handler runs on each re-render and as a result, it runs a request on each render, if you open the Browser’s dev tool → network you can see lots of the same requests to the server. Instead, you need to provide data somewhere else, for instance in “OnClick” event

does it make sense?

So i have transferred the logic for the repeater to the onClick event of the Add Participant button.

I don’t understand point 1.

check the error about whereclause on the second screenshot, it should be

objectId IN ('ID_1', 'ID_2', 'ID_N')

but your logic produces

objectId IN ('ID_1, ID_2, ID_N')

Hint: use Map block to wrap each id with single quotes

I think I’m close to getting this right. It’s the map method you suggested previously that I don’t know how to implement.

I get the error below.

try to test the received whereClause on the REST Console (in the Data Service), there is a problem with brackets

btw, you forget to use “Join” block to combine the list items into a text

When I use the block show above. I get a different error as follows.

I’m not able to use the REST Console for this because I’m making the test with Page Data.

Hello @Breldan_Muthaka,

you can log out the where clause with the print block to check a problem with brackets mentioned by @vladimir-upirov.


1 Like

Ok I see following your steps that my where clause does not list the IDs individually

So I’ve been able to do it by editing my make__text__from__list delimiter as follows.