Reference User Profile for the current user?

Discuss your general Proclaim related queries here.
coastal_living
Posts: 18
Joined: Mon Sep 27, 2021 11:58 am
Has thanked: 8 times

Reference User Profile for the current user?

Post by coastal_living »

I came across something posted about getting a value from the user profile for the current user and I tried to implement this into a question, but it didn't work - I was just wondering what I might have done wrong?

I have written the below, but when I run the Linked Action, whilst I am logged in, it says "Is this your Security Level: 0". But my Security level is 10.

QUESTION( "Is this your Security Level: " & USER-PROFILE(SECURITY-LEVEL) , "ALPHA" )

:?:

steve
Posts: 474
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 121 times

Re: Reference User Profile for the current user?

Post by steve »

Hi,

Proclaim doesn't like you using the function 'user-profile' inside another function 'question'.
Instead, first assign the result of 'USER-PROFILE' to a local variable, and use the local variable in the question:

Code: Select all

PROF = USER-PROFILE( "SECURITY-LEVEL" ) 
#MESSAGE( PROF ) 
QUESTION( "Is this your security level: " , PROF , "ALPHA" ) 
seems like an odd thing you are trying to achieve, but I presume this is just test code...