Discussions

 View Only
Expand all | Collapse all

Add record using QR code with API_AddRecord function

  • 1.  Add record using QR code with API_AddRecord function

    Posted 11-15-2021 17:01
    Hi Comunity, I created a Rich Text field that I succeed in adding a record using QR code  with API_AddRecord call 

    the challenge that I have is when I scanned it, save the new record but is not redirect to (var text redirect=URLRoot()&"db/"&Dbid()&"?a=q&qid=6";) and does  not link all fid list it on. see below my Rich text field

    var text redirect=URLRoot()&"db/"&Dbid()&"?a=q&qid=6";
    var text ADD = URLRoot() &"db/"& [_DBID_SCANS] &"?a=API_AddRecord"&
    "&_fid_6="&[Student ID] &
    "&_fid_9="&URLEncode("In-Person")&
    "&_fid_22="&URLEncode((ToTimeOfDay(Now())));

    "<img src=\"http://chart.apis.google.com/chart?chs=100x100&cht=qr&chld=|0&chl="&$ADD&
    "&NextURL=" & URLEncode($Redirect)& "\"\"/>"


    I have the same button but with url field type and it works perfectly 

    I tried to find a code page but I did not succeed, I will appreciate any help.

    ------------------------------
    Data System Analyst (Administrator)
    ------------------------------


  • 2.  RE: Add record using QR code with API_AddRecord function

    Posted 11-15-2021 17:53
    try this

    var text ADD = URLRoot() &"db/"& [_DBID_SCANS] &"?a=API_AddRecord"&

    "&_fid_6="&[Student ID] &
    "&_fid_9="&URLEncode("In-Person")&
    "&_fid_22="&URLEncode((ToTimeOfDay(Now())));

    var text Redirect=URLRoot()&"db/"&Dbid()&"?a=q&qid=6";

    var text  URL = $ADD
    & "&rdr=" & URLencode($Redirect);


    "<img src='http://chart.googleapis.com/chart?cht=qr&chs=240x240&chl="
    & URLEncode($URL)& "'>"




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



  • 3.  RE: Add record using QR code with API_AddRecord function

    Posted 11-29-2021 12:31
    Hello, Mark my apologies for the late response,  thank you so much, it worked beautifully.

    have a nice day!

    Ed

    ------------------------------
    Data System Analyst (Administrator)
    ------------------------------