Discussions

Expand all | Collapse all

Username to text field

  • 1.  Username to text field

    Posted 10-23-2014 20:35

    I am working on a way to log changes to specific fields. I have created a history field that records all the information I want to track when it is changed into an entry in that field. My problem is there are 2 user fields that have Full Name in them and when I attempt to pull than information out and into the new History field it only prints some id number associated with that user, I want it to print the Full Name of the User. My history field is a multiline text field.

    Below is the action to my dynamic form rule. It states:

    When the record is saved

    Action change history to <br><b>Status:</b> [Status] <br><b>Changed by:</b> [Changed by] | <b>Changed Date:</b> [Date Changed]<br><b>Tested By:</b> [Tested by] | <b>Tested Date:</b> [Tested Date]<br><br>

    Again, everything in this prints beautifully with the exception of the [Changed by] and the [Tested by].

    Here is what an output would look like:

    -- [OCT-23-14 4:19 PM Jordan] --------------
    Status: New
    Changed by: -58508613 | Changed Date: 10-23-2014
    Tested By: -58082747 | Tested Date: 10-24-2014

    Any guidance is greatly appreciated.



  • 2.  RE: Username to text field

    Posted 10-23-2014 20:37
    make a new field with the formula



    UserToName([Changed By])


    https://www.quickbase.com/db/6ewwzuuj?a=dr&r=e6&rl=fgv





  • 3.  RE: Username to text field

    Posted 03-11-2019 15:51
    Is there a formula that returns the username not the user's name?


  • 4.  RE: Username to text field

    Posted 03-11-2019 16:17
    Can you give an example? From what to what are you wanting converted?
    There are other functions like "ToUser(text)" or "UserToEmail(User)" or "User()"

    ToUser (Text t)

    Description: Converts a screen name or e-mail address to a user value. A "user" is an individual with whom you've shared your application. You'd translate something like an e-mail address into a user value so that QuickBase recognizes the user. When you do so, you can take advantage of user fields to design permissions and/or views. For example, show a user only those tasks that have been assigned to her. 

    Example: ToUser([Email Address]) takes the values in the Email Address field and returns their corresponding user values.
    ToUser("jsmith") returns the user with the screen name "jsmith". 
    ToUser("jsmith@example.com") returns the user possessing that e-mail address.  

    ----------------------------------------------------------------------------------------------------------
    UserToEmail (User x)

    Description: Returns the user's e-mail address.

    This function won't work for users who have hidden their e-mail address.

    Example: UserToEmail([Last Modified By]) returns the email address of the QuickBase user who last modified a record.

    ----------------------------------------------------------------------------------------------------------
    User ()

    Description: Returns the user currently accessing the database. 



    Example: With this function you can create a view that selects only the records modified by the user who is currently viewing the database.





  • 5.  RE: Username to text field

    Posted 03-11-2019 16:22
    Try ToText([my userid field]) to see a text field of the users username or their email address if they have not chosen a username.


  • 6.  RE: Username to text field

    Bronze
    Contributor
    Posted 03-11-2019 16:37
    The QB formula functions reference db is an invaluable resource.

    Unfortunately it looks like most of the functions in this category are mis-marked as 'Special' rather than 'type conversion' but nonetheless, check it out - I would guess everything you need is in there, Wendy.


  • 7.  RE: Username to text field

    Posted 03-11-2019 16:40
    Thanks everyone. Sadly none of those work.  Everything I have tried has either returned "last name, first name", "first name last name", or email address. Not the username. We have strict HIPAA issues and can't display names or emails. 


  • 8.  RE: Username to text field

    Bronze
    Contributor
    Posted 03-11-2019 16:42
    It might be time to create a new thread with your actual question. I'm going to be very surprised if whatever you're trying to do is something we can't easily do.


  • 9.  RE: Username to text field

    Posted 03-11-2019 16:45
    I agree - new thread especially because we are not understanding your question.  I suggest that you post a question with an example of the result you are looking for. 


  • 10.  RE: Username to text field

    Posted 03-11-2019 16:51
    The ToText( User() ) did work. I tried that one once but I must've done something incorrectly because I'm not sure why it didn't work when I originally tried it.  
    Thanks!


  • 11.  RE: Username to text field

    Top
    Contributor
    Posted 12-11-2014 06:12
    It logs the text name, but what the name was, not what it was changed to.  I have built an identical logging field that captures when a "ticket" (i have ticket app) is assigned to a new user. So it logs the person reassigning the ticket with the date time via the logging feature, but also lists the user it was reassigned to as the actual change.  Again, it updates and lists a new historical record, but the name it displays is what it was before I changed it, not what I changed it to. Sounds like the history record is created before the formula picks up on the change. Any thoughts on rearranging the actions of at the time of saving?  I'm going to try and delete the history field and readd it to see if it makes a difference. I already have the name formula field in a higher order on the form, so I know that wouldn't change anything. My thought is that I created the history field first. Maybe if I switch the creation order it will process the forumla before logging the historical change.


  • 12.  RE: Username to text field

    Top
    Contributor
    Posted 12-11-2014 06:49
    I found out the problem.  It uses the last Submitted name IF you hide the formula value. I found that I actually had to show the formula field, in the edit view, because if not the value would not update real-time while editing. Once I clicked save, it actually logged what I change the name TO, not from.