In the attached code, I am creating a simple report.

In the attached code, I am creating a simple report. I am using the a!gridField() function. The first column is referencing an id called "university_id". Instead of the ID, I would like to display the actual text. For that I created a query rule that given a university_id it returns the corresponding University object. Right now, in the first column of the grid, I am doing index(local!datasubset.data, "university_id", null). If I call the query rule as shown here: University_getUniversity(index(local!datasubset.data, "university_id", null)).univ_name, it will only display the name for the first row of the grid. Why is this happening?

OriginalPostID-183348

 

code.txt

  Discussion posts and replies are publicly visible

Parents
  • Per best practices, you will not want to loop over a query rule as it will be more costly. You can run one query to get all the id/name pairs for the current datasubset, save in a local variable, then call the apply over a function that gets the name from the variable (consider displayvalue function).

    forum.appian.com/.../Looping_Functions.html
    Section: Best Practices

    Another option is to call your query entity on a view that has the name as a column. This will move a query to the database and allow sorting on the name column to work alphabetically rather than on the underlying numeric id.

Reply
  • Per best practices, you will not want to loop over a query rule as it will be more costly. You can run one query to get all the id/name pairs for the current datasubset, save in a local variable, then call the apply over a function that gets the name from the variable (consider displayvalue function).

    forum.appian.com/.../Looping_Functions.html
    Section: Best Practices

    Another option is to call your query entity on a view that has the name as a column. This will move a query to the database and allow sorting on the name column to work alphabetically rather than on the underlying numeric id.

Children
No Data