Mapping through aggregate list

Hi All,

I have a question regarding mapping with the help of a 'Next' button.

For a project I have created an app that has questionnaires. These questionnaires have different topics with different questions. I am using a webblock inside a webscreen to show the relevant questions for that topic. When a topic is finished I want the user to click a next button to map to the next topic that was selected. Now this is the part where I got lost. 

Not every topic is mandatory so users can skip from topic 1 to topic 4 for instance.
The topics can be updated separately which will give them a new Identifier (so TopicId's will not remain iterative)

I have added a absolute position so that I always know in what order the topics need to displayed and what the next topic will be. 

My question regarding this is: How do I created something (a loop maybe) that can go trough my aggregate list and check if the current absolute position + 1 is inside the aggregate (so the user has selected it). If not present, it should do for instance current absolute position + 1 = 3 ; Absolute Position 3 is not present so do it again (3 + 1 = 4); 4 is present so fetch the topic Id that belongs to absolute position 4 and use this id as indentifier to open the next topic. 


I hope that my explanation is clear enough for you to understand. I find it hard to explain it since I am not sure about the exact logic that I need to use. 


Best Regards,
Max

Hi Max. 

Is Absolute Position the attribute of your Topic entity? So you can sort aggregate by Absolute Position ascending and create a CurrentRowNumber pointer variable. When Next button is clicked just increment CurrentRowNumber and get data from Aggregate.List[CurrentRowNumber].Topic.Id or another attribute you need.

Daryna Kravets wrote:

Hi Max. 

Is Absolute Position the attribute of your Topic entity? So you can sort aggregate by Absolute Position ascending and create a CurrentRowNumber pointer variable. When Next button is clicked just increment CurrentRowNumber and get data from Aggregate.List[CurrentRowNumber].Topic.Id or another attribute you need.

 Hi Daryna, 

Thanks for your reply. I have tried something like this but it seems that the currentRowNumber is reset to 0 every time I click the button. Meaning it will map from the first to the second questionnaire, but then it stops. 

What am I missing?

 

Hi Max,

Can you share some images of code what you tried.

Which application you are using Traditional or Reactive/Mobile


Regards

Rahul Sahu

Rahul Sahu wrote:

Hi Max,

Can you share some images of code what you tried.

Which application you are using Traditional or Reactive/Mobile


Regards

Rahul Sahu

 Hi Rahul, 

I am using traditional web app.

 The Aggregate gets all the Topics with a that have been assigned to a Subject and orders these by absolute position. The row number currentRowNumber assign, assigns the rownumber + 1 and the TopicId2 assign, assign the new topicid (which is used as input parameter on the destination)


Hi Max,

Basically you are redireact again same screen so in this case prepration run all current data lost.

but need to sure this screen take input parameter and filter data accordingly.

I give you a idea you can do this also.

1. Take same data type of list  which you receive data from aggregate

2. assign value in it and show on UI from This List use append list action to add record in list


Hope this will help you.

Regards

Rahul Sahu


Max de Groot wrote:

Daryna Kravets wrote:

Hi Max. 

Is Absolute Position the attribute of your Topic entity? So you can sort aggregate by Absolute Position ascending and create a CurrentRowNumber pointer variable. When Next button is clicked just increment CurrentRowNumber and get data from Aggregate.List[CurrentRowNumber].Topic.Id or another attribute you need.

 Hi Daryna, 

Thanks for your reply. I have tried something like this but it seems that the currentRowNumber is reset to 0 every time I click the button. Meaning it will map from the first to the second questionnaire, but then it stops. 

What am I missing?

 

 

 Don't use aggregate's CurrentRowNumber, create new screen variable.And get Topic from list where index is equal to this variable.

Solution

Thanks everybody for your ideas. I have resolved the issue using the following logic:

Solution