Hi All,
i have a query related to using join in expression
as you can see their is a logic mentioned in below code which is i am using in a database view but now i need to use this logic in expression rule to fetch the data so any one can help me to implement this logic or you can give any example
we requird the filter on below case
SELECT a.IDeChangeAffectedElements as IDsiteHistory, a.eChangeRequestDetailsID, a.siteid, a.sitename, a.location, a.network, a.elmid, a.elmalias, a.elmaddress, a.createdby, a.createddate, a.modifiedby, a.modifieddate , b.plannedstartdate as startdate, b.plannedenddate as enddate, b.EtimeCode FROM eChangeAffectedElements a WITH(NOLOCK) left join eChangeRequestDetails b WITH(NOLOCK) on a.eChangeRequestDetailsID = b.IDeChangeRequestNumber
Discussion posts and replies are publicly visible
Expressions in Appian do not support DB joins. I suggest to have a look at synced records and related record queries.
If you're doing traditional (entity-wise) querying in the expression rule, you merely create a DB view that utilizes the joining logic you want, create a Data Store Entity pointing to that view, then query it in your code.
If you're using RecordType data (synced records etc), you should be able to do basically the same thing inherently in your data structure by configuring Related Record Data.
As Stefan mentioned, "joins" in expression code aren't really a thing. The closest you could come is to query from table A and query from table B with filtering on the values you've already retrieved from A, which could work depending on what your requirements are, but doesn't scale well (it gets pretty costly if your volume of queried data starts to become large at all), and doing the necessary coding requires precise and sometimes confusing intricacy.
hi hritiks4748 there are two ways, One could be creating a view for that code and next creating a data store entity in Appian and querying the DSE. The approach would be to create a stored procedure in the database for this code, and in Appian call the stored procedure using the function named a!executeStoredProcedureForQuery()