Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SubField to check the Username with logged in User

Hi,

This may seems to be a basic question, but, we have a table as Region Table -

    

REGIONEMAILUNAMEUGROUP
R1abc@123.comabcINFO
R2abc1@123.comabc1TEST
R3abc2@123.comabc2

TEST2

and flag table as -

  

UGROUPRFLAG
INFO0
TEST1
TEST21

We have a requirement, where we want to set default value as REGION, where UNAME is logged in user.

If the RFLAG for the User Group is 0, then default will not be set.

We are using these configuration in the Section Access Hidden script, so, I have tried with below expression in Select in Field of REGION as -

=if(sum(RFLAG)=1,

MAXSTRING({<SubField(OSUser(),'\',2)=UNAME}>}REGION)

)

But it throws an error.

Please assist.

Regards,

MK

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

try switching the condition otherway round

=if(sum(RFLAG)=1,MAXSTRING({<UNAME={"$(=SubField(OSUser(),'\',2))"}}>}REGION))

HTH

Sasi

View solution in original post

3 Replies
sushil353
Master II
Master II

share your desired output as well

sasiparupudi1
Master III
Master III

try switching the condition otherway round

=if(sum(RFLAG)=1,MAXSTRING({<UNAME={"$(=SubField(OSUser(),'\',2))"}}>}REGION))

HTH

Sasi

Anonymous
Not applicable
Author

Thanks Sasidhar,

I have just modified the expression, as there was one extra bracket which was coming -

=MAXSTRING({<UNAME={"$(=SubField(OSUser(),'\',2))"}>}REGION)

Thanks again.

Regards,

MK