Create a Query and use it in Server Flow
In the context of leave management application, "EmployeeDetailsByUserId" query is created to fetch the employee details based on user id and used in a server flow to expose it as an API. The following section provides information on how to create a query and use it in a server flow.
To create "EmployeeDetailsByUserId" query, refer to Create Queries. Here "Employee" is the entity used and query is " SELECT [Employee].* FROM [Employee] WITH (NOLOCK)
WHERE
( [Employee].[UserId] = @UserId ) ".
To create a server flow, refer to Create Server Flows. Here "GetEmployeesByUserId" server flow is created and exposed as an API.
To call the Run Query construct, refer to Run Query. Here the query "EmployeeDetailsByUserId" is used and the output mapping is done as required.