Show Text for Conditionally
Question
Application Type
Reactive
Service Studio Version
11.10.21 (Build 41765)

Hi,

Reactive Application

I have to compare the values from two different aggregate in the screen if they don't match then show "Sample text" otherwise no.

In a screen i have two aggregate

1) ScreenAggregate 

2) CompareAggregate

I want to compare ScreenAggregate.attribute1 = CompareAggregate.attribute1

How can we compare this as the Aggregate is fetched parallel in Reactive web app


Thanks....

Hi Rohan J ,

A simple way is to refresh after the execution of the first table, for example, in the ScreenAggregate properties, create an action "On After Fetch":


In Action, use a "Refresh Data" for the comparison table:



And to not consume initial execution memory, change the Fetch attribute of the CompareAggregate table to "Only on demand":


There are other ways like creating a "DataAction" and placing the sequential structures (simulating the Traditional Web Preparation). But this path I showed is simpler.

Hope this helps.


Best Regards,
Edson Marques


mvp_badge
MVP

Hi Rohan,

You can use IsDataFetched property of the aggregates along with you compare logic.

If this is not enough, you can set second aggregate to fetch only on demand instead of at start. Create OnAfterFetch action on your first aggregate and in this action refresh second aggregate. After refresh you can compare and them and set your variables to display text

This may not be the best way to do this but based on the available information this is an option.

Hi Rohan,

I see here two possibilities:

1. You can do a Fetch Data from Other Source and place both aggregates there. This way you guarantee that they are both ready.

2. You can put one of the Aggregates with a Fetch At start and the other Only on Demand. After Fetching the first one you can do a On after fetch and Trigger the next one to start. This means that when the second one is fetched, you have all the information that you need.

However, there may be more optimized solutions. 

Best regards,

João Delgado

Hi Rohan J ,

A simple way is to refresh after the execution of the first table, for example, in the ScreenAggregate properties, create an action "On After Fetch":


In Action, use a "Refresh Data" for the comparison table:



And to not consume initial execution memory, change the Fetch attribute of the CompareAggregate table to "Only on demand":


There are other ways like creating a "DataAction" and placing the sequential structures (simulating the Traditional Web Preparation). But this path I showed is simpler.

Hope this helps.


Best Regards,
Edson Marques


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