22
Views
2
Comments
Help me how to put the filter condition
Question
Application Type
Reactive

Hi, 

I have assignments aggregate. I need to filter the assignments in a way like:-

Get the user id of the current logged in user. There is a entity in which the user id and KVK number is linked with each other. Now based on current user id, we need to get the KVK number.

Each KVK number has a Role which is present in another entity. Now get the KVK number by user id and find his Role and based on these factors, get the assignments.

Please help me how to form the filter condition for this.

Hi Gayathri,

1. You can add KVKnumberentity and RoleEntity in an aggregate and use "Onlywith" join.

Your join condition should be KVKnumberEntity.id = RoleEntity.KVKNumberId something like this based on your data model.

Now goto filter section,

You can use the GetUserId() function to pass the current logged in user id into your filter to get the KVK number.

ForEg:

KVKNumberentity.userid = GetUserID()

This should give you the required output.

As per my understanding with your problem, you can try this way.




Hi Gayathri,

To get the KVK number based on user id you can apply the filter with GetUserId() built in function in the filter tab of the aggregate like this . GetuserId() = KVK.UserId

Now to get the role based on KVK id you can apply filter by KVK.RoleId = Role.Id, this will give you the required role.

now finally to get the assignments you have everything you need, i.e. UserId, KVKId and roleId.

Let me know if this doesn't clear your doubt, or share an OML for better reference.

Hope it helps.

Thanks

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