How to compare the value in a UserSelector field

I have a field with the type of User Selector , based on the value of that field select/dropdown field should be displayed. what is the condition expression I could use there? I used this expression but didn’t work , record.values.OwnerId == “abc” OwnerId is the name of the variable field.

Hello @Duleep ,

could you try ${record.values.OwnerId} = “abc”

@KVAE
Failed to evaluate record block field conditions: 374674417709547522: parsing error: ${record.values.OwnerId} == “abc” :1:1 - 1:2 unexpected “$” while scanning extensions
It gives this error.

any suggestions how this can be handled?

Is there any reference that I can refer to regarding user selector functionality.

This is the scenario ,

This way it doesn’t work, OwnerId type is User Selector, with select /dropdown this syntax works, but with User Selector it doesn’t work.

ownerID is a userID, so you have to compare IDs.

record.values.OwnerId == "123" or record.values.OwnerId == record.values.UserField

Hi @jfortun I did not get this answer , could you explain it some more, is there any expression I could use for UserSelector, Here OwnerId is the field name, variable name set in the modules page for opportunity.


Here in this page we give OwnerId name

Hi @jfortun , I am using a UserSelector field type for OwnerId . There I have string values, I don’t know where to get the Id of them, could you say a place where I could find Id of them in the crm.
I am using it like this ,


String value is compared. No id

You can look in the Admin Area in the user list, to see their ids.

Hi @jfortun


This is the screen in the user list I can see , how to find the id of them

Hi @jfortun when I use the Handler I don’t get any thing, Can’t find user id’s in this screen, where to find them

You can look at the URL when editing the user
The URL should look like https::/YourDomain.com/admin/system/user/edit/<userID>

@jfortun thanks, Yeah it worked, but the issue is I need to display the select /drop down field once the user login to the system, with the owner id that is selected that time, but here once I changed the owner id in the User selector field this works, I need it to work once I load that screen before making a change in the Owner id, for the value selected there it should show the select /dropdown before making a change there. According to the logged user the select/dropdown fields should show up, here it takes from the owner id. How to implement it?

Hi @jfortun ,
image
When I logging to the system form Ridmal account when the first time it loads the page it doesn’t show the region, it is the issue , how to fix this,

image
In the second time when I select the Ridmal user from the User Selector field it shows the region,
How to fix this issue

Hi @jfortun , can we do this from a script, if so where to add the script in corteza application.

Im guessing you have the condition set like that, so it only shows up if one of the values is selected.
If you want it to show up only if the logged in user is in the condition then you have to use the user.userID instead of record.values.OwnerId

Here are the docs for scripts

Hey @jfortun , Here record.values.OwnerId is the userSelector field name, that is why it is used. When using user.userID I get this error,
Failed to evaluate record block field conditions: 384909311907725315: can not evaluate user.userID == “362569145146998786”: unknown parameter user.userID

User object is not present in field conditions. Will be added in 2023.9.6

1 Like