This recipe is to describe the steps to create a website page where a logged in user can submit data that will be displayed to him/her only. Typical scenario is a website where you can tell something about yourself. In scenario below we let the visitor store where he/she wnet on a last vacation.

  1. Create a table in the database, like MyInfo
  2. Set the schem at dbo
  3. Create a column Id
  4. Make Id a primary key
  5. Make Id not nullable
  6. Create a column MyInfoGUID
  7. Create a column UserId
  8. Create a column like 'LastHoliday' in MyInfo
  9. Switch to your DNN
  10. Add ActionForm
  11. Add a field LastHoliday 
  12. Add button
  13. Add action to button : data - run sql query
  14. SET LANGUAGE DUTCH
    INSERT INTO dbo._MyInfo (MyInfoGUID,UserId,LastHoliday)
    VALUES (newID(),@UserId,@LastHoliday)
  15. Add bind tokens
    MyInfoGUID -> [MyInfoGUID:Value]
    UserId -> [User:UserId]
    LastHoliday -> [LastHoliday]
  16. Save
  17.  In the section FormEvents, create an action onInit
  18. Data - Run SQL query
  19. SELECT TOP (1) 
    dbo.MyInfo.LastHoliday
    FROM dbo.MyInfo
    WHERE (dbo.MyInfo.UserID = @Loggeinuser)
    ORDER BY Id DESC
  20.  
    Add bind token to onInit action:
    Loggeninuser -> [User:UserID] 
  21. Add an extract column:
    LastHoliday -> LastHoliday