Forum Discussion

kpmcdonakpmcdon's avatar
kpmcdonakpmcdon
Qrew Trainee
6 years ago

curuser marker in webhook using API_ImportFromCSV

I have a webhook using API_ImportFromCSV that populates fields in an audit log table triggered by the deletion of one or more records in the main table. It works great, except for one problem. I am trying to capture the name of the user that deleted the records. When using a field I can add the '.csv' suffix to properly format the data. I don't know how to do this with a marker, like curuser. Thus, I get the user's name followed by the extra characters I would get with a field were I had forgotten to add the '.csv' suffix.

What is the proper way to grab the name of the user that performed the delete?

2 Replies

  • Good day kpmcdona,

    I had to create a similar webhook today and found that curuser always equals the webhook owners' name and userid. The only way for me to get this to work was to use new.Last Modified By. Here is a section of my webhook to illustrate:

    <qdbapi>
    <usertoken>{your token will go here}</usertoken>
    <skipfirst>0</skipfirst>
    <clist>3.116.115</clist>
    <records_csv>
    <![CDATA[
    %RepeatOn%
    [Record ID#],[new.Last Modified By],%curdate%
    %RepeatOff%
    ]]>
    </records_csv>
    </qdbapi>
    • kpmcdonakpmcdon's avatar
      kpmcdonakpmcdon
      Qrew Trainee
      Yes, 'new.Last Modified By' is how I handle this in other cases. Sadly, if the record is deleted there doesn't appear to be a value in that field so the value that gets captured is blank/null.