Forum Discussion

DanielJohnson2's avatar
DanielJohnson2
Qrew Trainee
3 years ago

How to Add Multiple Users in API_AddRecord

Hi All,

I've got this in a Formula URL field:

URLRoot() & "db/" & [_DBID_CHILD] & "?act=API_AddRecord&apptoken=xxxxxxxxxxxxxxx123456789&_fid_30_=" & [Record ID#]
& "&_fid_47_=" & ToText([Associate])
& "&rdr=" & URLEncode(URLRoot() & "db/" & [_DBID_PARENT] & "?a=dr&rid=" & [Record ID#])

fid 47 is a User List field and there are a couple instances when the child record needs to be created with several users in that field. One of the users will be from the [Associate] field, and the other user will always be the department head, John Smith. What's the syntax to add John Smith along with the [Associate] field?

Thanks,

------------------------------
Daniel Johnson
------------------------------

1 Reply

  • Try this - we will use a semicolon delimited list to populate the field.

    var text People = List(";",  ToText([Associate]), ToText([Dept Head]));

    URLRoot() & "db/" & [_DBID_CHILD] & "?act=API_AddRecord&apptoken=xxxxxxxxxxxxxxx123456789&_fid_30_=" & [Record ID#]
    & "&_fid_47_=" & URLEncode($People)
    & "&rdr=" & URLEncode(URLRoot() & "db/" & [_DBID_PARENT] & "?a=dr&rid=" & [Record ID#])

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------