This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ITShop %useruid% Use in Organizational Attributes

I am trying to get the uid of the current logged in user in a filter in Employee -> Organizational Attributes under Configure Project. 

I have a lengthy filter that works great if I manually add my guid such as ... WHERE uid_person ='manuallyaddedloggedinguidhere' AND...

But if I try to use the variable ... WHERE uid_person ='%useruid%' AND... it does not work as expected. I suspect it is resolving to NULL/empty. I also tried

WHERE uid_person = (select top 1 uid_person from User) and it fails to compile, though the query syntax is valid. I tried several other ideas and avenues with no luck. I am guessing this query is executed server side and does not have access to the client side data? What do I need to do to be able to filter by the logged in user uid from Organizational Attributes?

 

Parents Reply Children
  • The variable is not being evaluated. It shows up as the string useruid with percents around it (this forum wont let me post the SQL or percents for some reason anymore and the insert code tool says I don't have permission). 

  • I was able to get a solution from another quest employee: 

    Adjust your query based on example below:

    format("from user select firstname where uid_person = '{0}'", GetUser())

    GetUser() would return the UID you need.

    also consider SQLInWithFormat() function for your WHERE clause.