Skip to main content
Question

How to Add CurrentUser to User List field

  • March 23, 2020
  • 0 replies
  • 288 views

JimHarrison
Forum|alt.badge.img+16
I have searched the API, formulas and community and don't see anything. Wondering if there is an API function for adding the current user to a User List through a URL Formula?

The idea is to expose a button on a report that says Subscribe on it. When the User clicks the button their username is added to the User List field. The report is displayed on the App Home page, where each record is a separate topic of interest.

We won't have a lot of Subscribers so a User List is ok. We want to experience to exclude opening the record and adding the User name to the list.

This doesn't work:
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid61=User()&apptoken=



URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid61=[??WHAT DO IT PUT HERE??]&apptoken=

Thoughts?

------------------------------
Jim Harrison

------------------------------

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • March 23, 2020
var text MyUserList = Totext([userlist2]); // insert your List User field here

var text NewUserList = List(";",$MyUserList, totext(User()));

var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_99=" & $NewUserList;

var Text DoIt =

"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);";

if(not contains($MyUserList, Totext(User())),$DoIt) // only add the Current user iF not already subscribed

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