Skip to main content
kavyam0002
September 13, 2024
Question

writing a expression rule for the query from DB

  • September 13, 2024
  • 5 replies
  • 0 views

this is the query how can i write a expression rule for this and the result will be like below

    5 replies

    mikes0011
    Brainy
    September 13, 2024

    What's wrong with using QueryEntity or QueryRecordType (depending on which type of data you have configured within Appian)? These are both pretty powerful and you can filter to pretty much anything you want using a!queryFilter() or an array of filters contained in a!queryLogicalExpression().

    kumara0180
    September 13, 2024

    As [mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05]  suggested use queryentity or queryrecordtype. Please go through https://docs.appian.com/suite/help/24.3/Query_Recipes.html if you are new to Appian to understand how this can be achieved. 

    vinaykumarp8308
    Participating Frequently
    September 13, 2024

    [mention:bd2e537916fe4b31980bfba549754efc:e9ed411860ed4f2ba0265705b8793d05] 

    If your query is a simple select statement, you can directly query from db using QueryEntity or QueryRecordType. Within these you can modify data like applying filers. 

    In case of joins and unions, I would prefer to go with view in the backend and then query through QueryEntity or QueryRecordType.

    Query Recipes - Appian 24.3

    somasundaram.d
    September 14, 2024

    Accessing the data from the database can be achieved in two ways in your case:

    1. Query entity : Appian's OOB functionality to query a data from the connected DB tables and views

    2. Query Database Smart Serviceused to retrieve information from an external database using a SQL query, and update or create process variables using the query results. This activity also permits you to create tables and select, insert, and update rows in database tables from your process model.

    Please refer this link for more info

    docs.appian.com/.../Query_Database_Smart_Service.html

    parthasarathym6661
    September 23, 2024

    You can use query entity function and provide the required filters using query filter. In case if you want to use joins, then you can use views on DB and use that view for query entity.