Plugin Contributor
Kim L
(@kimmyx)
Hi @mahoney,
Could you send us more details about your table? Is this for a data table or a data project?
You can also send us a message in Contact | WP Data Access if you want to share more information privately.
We’ll wait for your response!
The table is simple: id, item, image, wp_user_id
what I need to happen is when a logged in user creates/edits a record is for the @wpda_wp_user_id to be passed into the record for wp_user_id.
I guess this would be a data project since it needs to be on the front end forms.
Plugin Contributor
Kim L
(@kimmyx)
Hi @mahoney,
Thanks for the clarification!
I think you need to set a trigger for that if you want the current logged in ID to be entered when editing/inserting a new record.
Please see more information here: WordPress user ID – Database triggers
Let us know if that helps! 😊
Thank you for the reply. I found that using the Environment Variable $$USERID$$ placed in the Default Value under Project Templates >>Data Entry worked for me. I unchecked Visible and checked Read Only.
Triggers look very interesting, where would I place the code for a Trigger?
Hi @mahoney ,
On behalf of Kim, you are most welcome!
You can execute the triggers via query builder.
Please see: https://wpdataaccess.com/docs/query-builder/query-builder-getting-started/
Let us know if you have further questions.