Only displaying the first 4 items in my list using gallery widget
Application Type
Traditional Web, Reactive
Service Studio Version
11.54.26 (Build 62807)

I want to display only 4 of the items from the list in my gallery, is there anyway i can do that? or is there a better tool i can use to display the items in my list from my database 

And is it possible for me to have a pop up for each item in my gallery, where this pop up gets the data from the database based on what is on the gallery. Right now the same content is being displayed for all the gallery items. This is what it looks like so far:

Hi SPM RegSync,

You can control how many records to show on your List widget by providing in its Source property a List that only contains the required number of Records.

If you only ever need those first four records, you can use the Start Index and Max. Records properties of an Aggregate to limit which records it returns.

If, on the other hand, you need the full list for other functionality, but in this particular Gallery you only want to how the first 4 records then you will need to create a copy of the original source with just a subset of the records. You can do this on the OnAfterFetch handler, for instance, where you fill out a local variable with the relevant data for the Gallery's List widget. You would then use the local variable as the Source property value of your Gallery's List widget  

Regarding the second part of your question, every time you open the popup, you will need to fetch data from the database to populate it.

You can do this by:

  • refreshing a screen aggregate (so in the OnClick handler where you show the popup, before you show it you would use the Refresh tool to re-execute, for instance, a GetUserDetails aggregate that has its Fetch property set to Only on demand) or;
  • putting the contents of the popup in a Block that receives a SelectedUserId and has an aggregate to fetch that specific user's information (in this case, before you show the popup you would need to update a local variable with the clicked user's id, pass it as the input to your block and on your Block make sure you handle the On Parameters Changed event to refresh its aggregate).

Hope this helps!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.