Can I "run code" attached to click event in the UI that calls an integration to insert row into a table

I have an input field and I know how to use the UI to add a onclick event to add a row into table. Or alternatively I can get the click event to “go to page” using the UI.

Ideally I want to write some code using “run code” that will either add a new row to a table or go to a page that shows the row depending on the content of the input field.

Is it possible to call an Insert Row integration with a JSON object with the table name and fields and their values or go to a page that shows an existing row in the table.

Sorry new to all this so if it is possible to write code to do the required calls can you point me in the right direction.

Hi, you can use dynamic pages to show data specific to a given resource (Dynamic pages and paths | Learn Plasmic). You should also be able to insert rows
with specific data. You can go through the app tutorial in Studio to learn how to do it.

yea, i have a similar question posted not long ago, the solution makes no sense (I think?) if I understand you are asking if you can basically expose server functions (e.g. server actions, or any functions) that can be called in plasmic code editor using variables such as $xxx something something.

The link in the post by fmota is talking about paths and path param integration with code components. It has nothing to do with the question. Not sure who flagged that as the solution

My thought process are that you might need to use data provider in a unintended way, instead of passing data into it, you pass functions into it, then see if you can use it inside as a code component to run that code in Plasmic Studio.

I haven’t tried it yet but will try it soon

I think fmota got confused by the question here!

What you can do in this case is add both interactions in the onClick handler, but add a condition for both depending on the variable you’re using, so the action only runs When X is true for example.