785
Views
3
Comments
Function
Question
Application Type
Reactive

Hello 

 Can we make function like  GetuserId()?

to get data from our custome entity.

2022-02-25 19-42-59
Srinivas K Singadi
AI Generated

Hello Rishabh Bawne

Yes, in OutSystems, you can create custom functions to retrieve data from your custom entities. Here are the steps to create a function to get data from your custom entity:

  • Create a new server action: In OutSystems, server actions are used to define custom logic and data access. You can create a new server action by right-clicking on the module and selecting "New Server Action".
  • Define input parameters: In the server action, define input parameters that will be used to filter the data you want to retrieve. For example, if you want to retrieve a specific record from your custom entity, you could define an input parameter for the record ID.
  • Add a query: In the server action, add a query that retrieves the data from your custom entity based on the input parameters. You can use the built-in Entity action or SQL queries to retrieve the data.
  • Return the result: In the server action, return the result of the query as an output parameter.
  • Call the function: In your application, you can call the function by passing in the necessary input parameters. You can use the result of the function to display or process the data as needed.
This answer was AI-generated. Please read it carefully and use the forums for clarifications
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Rishabh,

A Function in OutSystems is just an Action with a single output parameter that can be used in an expression. Note however that since you are using Reactive, it is not possible to have asynchronous calls to the server, so you cannot use server actions inside a client-side function.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.