Discussions

Expand all | Collapse all

Populate List-User Field Using Formula URL

  • 1.  Populate List-User Field Using Formula URL

    Posted 28 days ago
    Hello and happy Friday!

    I have an application with records that users will be reviewing. I have created a Formula - URL (as a button) on each record that the user can click and be assigned to that record. The formula-URL field populates a User field that marks them as the "owner" or "lead" of that record.

    I would like to create a similar functionality for those that do not wish to "own" that record but would like to "watch" or "follow" this record. I have tried following the same general method with a List - User field (multiple people could elect to be a watcher) but with the formula I have currently the last person to click the "follow" button replaces the previous.

    For example: If Jack and Jill want to keep tabs on a record they would click the "follow" button when it appears on their dashboard as a new item. Say Jack sees it first and clicks "follow", the formula adds Jack's name to the List - User field. If Jill then comes in and clicks the "follow" button, it replaces Jack's name with Jill's instead of adding Jill's name to the List - User field.

    Here is my formula: URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_60=" & UserToEmail(User()) & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid())

    Do I need to change something up in my formula to make this work?

    ------------------------------
    Thanks in advance,
    Jennifer Paschal
    ------------------------------


  • 2.  RE: Populate List-User Field Using Formula URL

    Posted 28 days ago
    I haven't tested this... but what you might be able to do is where you set the _fid_60 to UserToEmail(User()), you're overwriting the current value.

    if you ammend that to perhaps:

    ToUserList([Follow], User())

    Then I believe that will keep the current and add the current user.

    ------------------------------
    Ryan Stanford
    ------------------------------



  • 3.  RE: Populate List-User Field Using Formula URL

    Posted 28 days ago
    It does not like the User() portion of that formula. It says it is expecting a UserList. See image below:

    Any ideas on what else to try/tweak?

    Expecting UserList formula error


    ------------------------------
    Thanks in advance,
    Jennifer Paschal
    ------------------------------



  • 4.  RE: Populate List-User Field Using Formula URL

    Posted 25 days ago
    Anyone have any suggestions on this?

    ------------------------------
    Thanks in advance,
    Jennifer Paschal
    ------------------------------



  • 5.  RE: Populate List-User Field Using Formula URL

    Posted 25 days ago
    What is not working with how your formula is set up how?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 6.  RE: Populate List-User Field Using Formula URL

    Posted 25 days ago
    Edited by Austin K 25 days ago
    Just an FYI but doing it in this way you are limited to 20 users being in that field at once. When you go past that limit the field becomes blank.

    If that is not an issue then continue down that path. If you ever see yourself needing 20+ userrs watching something this may not be the right way.

    I would try 2 things. First try setting a variable up as the User() and use that instead of User() in the URL.

    Var User myUser = User();

    Sorry if this is not accurate to the formula in the picture but I'm not writing it out from there. I just copied it from the first post.

    URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_60=" & URLEncode(ToUserList([Watchers], $myUser)) & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid())

    If that does not work and still complains about the user error I would try creating a formula user field and have it be simply User() and then try adding that to the URL instead.

    URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_60=" & URLEncode(ToUserList([Watchers], [MyUserField])) & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid())

    Edit: You know the problem may actually be with trying to stuff a user list into another user list... You may need to somehow breakdown the current Watchers/Followers list into individual entries and then add them all to and updated user list before sending that api call.


  • 7.  RE: Populate List-User Field Using Formula URL

    Posted 25 days ago
    Edited by Mark Shnier (YQC) 25 days ago

    Well yes it is always helpful to tell us what's not working when you have a syntax error.  :)

    Try this change
    & "&_fid_60=" & UserToEmail(ToUserList(User())) &

     



    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 8.  RE: Populate List-User Field Using Formula URL

    Posted 24 days ago
    This change ->  UserToEmail(ToUserList(User())) causes the same error but in the other direction. Instead of saying "expecting UserList and found like" it says "expecting User and found User List"

    The solution of created a separate formula - user field and assigning it =User() also has the "expecting UserList and found User" error


    ------------------------------
    Thanks in advance,
    Jennifer Paschal
    ------------------------------



  • 9.  RE: Populate List-User Field Using Formula URL

    Posted 23 days ago
    I tested your original formula which is essentially this

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_20=" & UserToEmail(User()) & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid())

     and it worked just fine,

    Can you post the error message you get when you save your original formula?  Not the syntax error checker in the formula box but the error message that you get when you go to Save the formula,.

    ie this formula here

    URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_60=" & UserToEmail(User()) & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid())




    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 10.  RE: Populate List-User Field Using Formula URL

    Posted 23 days ago
    Hi Mark,

    There is no error when I save (or any syntax error) for the original formula. The issue with this is that is does not work the way I want it to. When the user clicks the button for this URL formula it places their name into the [Watchers] List-User field. However, if someone else attempts to do the same, it will replace the first user's name with the second instead of expanding the list of users to 2.

    I hope that makes more sense. Please let me know if it is still not clear!
    Thanks!

    ------------------------------
    Thanks in advance,
    Jennifer Paschal
    ------------------------------



  • 11.  RE: Populate List-User Field Using Formula URL

    Posted 23 days ago
    I should have read your post more clearly. I was hung up on the syntax error.

    URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_60=" & List(";", ToText([Userlist]), UserToEmail(User()))
    & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid())



    Replace the [Userlist] with the field name for your List User field of Wacthers..

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 12.  RE: Populate List-User Field Using Formula URL

    Posted 23 days ago
    Thank you, this worked perfectly! Thanks so much for your help!

    ------------------------------
    Thanks in advance,
    Jennifer Paschal
    ------------------------------



  • 13.  RE: Populate List-User Field Using Formula URL

    Posted 23 days ago
    Glad we got there in the end.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------