Jump to content
  • 0

Include Authentication Values in Calculated Field


Connonymous

Question

I would like to use the ID of the logged in user within a calculated field. The only hang up right now is figuring out if this is possible, and if so how to do it, so the simplest possible solution that accomplishes this would be the goal-- create a calculated field that is always equal to the ID of the logged in user. I tried the simplest possible, just entering [@authfield:Employee_ID] in the calculated field, but I receive an error that says: "Invalid column name '@authfield:Employee_ID'." Is it possible to accomplish this?

In case this is helpful in resolving the issue, my ID is a formula field, the datapage is a Combined Chart and Report.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello @Connonymous,

It is possible to use auth parameters in Calculated field/Calculated Value. 
Just wrap the field in single quotes: '[@authfield:Employee_ID]'
Single quotes are not needed  if you add the field that has Number, Integer, Autonumber data type.

But if the data type is text single quotes are required. Most of the auth fields like Email, First_Name, Address, Role, etc. are usually text values.

Formula field that concatenate several values has text data type too.

Hope this helps. 

Link to comment
Share on other sites

  • 0
4 hours ago, CoopperBackpack said:

Hello @Connonymous,

It is possible to use auth parameters in Calculated field/Calculated Value. 
Just wrap the field in single quotes: '[@authfield:Employee_ID]'
Single quotes are not needed  if you add the field that has Number, Integer, Autonumber data type.

But if the data type is text single quotes are required. Most of the auth fields like Email, First_Name, Address, Role, etc. are usually text values.

Formula field that concatenate several values has text data type too.

Hope this helps. 

Thank you, this is very helpful! Just tried it and it works just as you described. I really appreciate the help!

Link to comment
Share on other sites

  • 0

Authentication and calculated fields are treated as parameters, personally regardless of the datatype, I always encapsulate them to single quotes and unless they are meant to be used as strings, I will just convert them into what data type they are supposed to be. 

Saves me a lot of trouble from calculation or formula errors.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...