@greywire (Aric Caley) posted a new topic, subject "Insert additonal table records on user register". It read:

   I want to insert additional records into a table when a user registers with dreamfactory. I have attached a script to the ‘user.register.post.post_process' event, but no matter what I do I cannot insert anything or figure out the user's id. How do I do this?

To which @m_menon (M Menon) replied

    The role needs to have permission to insert into the table. You may want to confirm that first. You may be able to get some info from the dreamfactory.log file too if it's a permissions issue

So @greywire (Aric Caley) replied

    Which role? After the user is registered, in this post_process event, will it be logged in as that user and thus his role? or will it still be ‘anonymous' role? How do I get the ID of the newly created user record?

So @drewpearce (Drew Pearce) replied

    user register is an anonymous call (one of the few allowed in DF.)  
    You'll need to include authentication in your script, such as with an API key that has a default Role.

To which @m_menon (M Menon) replied

    When you created the application you would have assigned a default role to it. Now that role should have the rights to insert data into the(that) table. Have a look at the app settings and see what role it uses, and then look under the “Access” tab of that role to see what it is allowed to do. If there are more CRUD ops that you want it to do, then set the Access rights accordingly.
    
    I am just displaying an example of javascript addresbook application available in the example apps
    
    Pasted image998×331 10 KB
    
    * * *
    
    Pasted image1245×507 17.1 KB
    
      
    Cheers,  
    M&M


{'source': 'discourse', 'url': 'https://community.dreamfactory.com/t/insert-additonal-table-records-on-user-register/2480', 'title': 'Insert additonal table records on user register', 'views': 1960, 'has_accepted_answer': False, 'word_count': 265, 'like_count': 0, 'reply_count': 2, 'participant_count': 3, 'posts': 5, 'tags': '', 'author': '@greywire (Aric Caley)', 'participants': '@greywire (Aric Caley), @m_menon (M Menon), @drewpearce (Drew Pearce)', 'image_url': [None], 'created_at': '2016-04-04T20:40:03.686Z', 'last_posted_at': '2016-04-06T02:59:55.920Z'}