56
Views
8
Comments
Solved
Compute data and insert into database
Question

Hi All,

I am new to outsystem.

I would like to pass some derive value(example: created date, description) and form data and insert into database.

Notice that most of the example is directly get from form record, but i am not able to do so due to derive value.

How can i assign the value into the field of the table structure and insert into database table?

Example: my form has only 1 input field - count.

But i would like to insert additional data such as "In/Out", created date, created time, count and so on into database table.

Thank You.


Rank: #89
Solution

Hi Ting Xuan Chong,

when you call entity data create  action just before assign value which not pass from Form Inputs

just like 

entity.Fieldname="Value" 

and after that assign this entity to create action. this is a write way.

also you can do one thing create a server action for Insert data into Entity and this server action take only input which provide by form value and other value of fields assign in this server action.


Regards

Rahul Sahu

Rank: #146
Rank: #10651

Ting Xuan Chong wrote:

Hi All,

I am new to outsystem.

I would like to pass some derive value(example: created date, description) and form data and insert into database.

Notice that most of the example is directly get from form record, but i am not able to do so due to derive value.

How can i assign the value into the field of the table structure and insert into database table?

Example: my form has only 1 input field - count.

But i would like to insert additional data such as "In/Out", created date, created time, count and so on into database table.

Thank You.


Hi Ting Xuan Chong,

Expand (click on the + icon) the source property of the operation and you can assign desired values in there.



Rank: #89
Solution

Hi Ting Xuan Chong,

when you call entity data create  action just before assign value which not pass from Form Inputs

just like 

entity.Fieldname="Value" 

and after that assign this entity to create action. this is a write way.

also you can do one thing create a server action for Insert data into Entity and this server action take only input which provide by form value and other value of fields assign in this server action.


Regards

Rahul Sahu

Rank: #44

Hi Ting,


Please see the below might it help.

mvp_badge
MVP
Rank: #64

HI Ting Xuan Chong,

I would like you to understand few things here .

1. Any action like CreateTrans , CreateOrUpdateTranse need an record input parameter of the same entity type and it is not always required that this source can only be get from form record.

You can create a local variable of the entity record type and assign the value to that record , you can also bind the attribute of that record to the widgets like input box , drop-down etc to hold the value directly and than can pass that record to entity actions as required.

Regards,

-PJ-