Task Reports - Adding Data Columns - What rules can I use?

I have a task report and in order to build a range of filters for the data, I need to add new columns for the report.  The task names are formatted to combine data about the task.

TaskName for CustomerName - CaseNumber - SellingBranch  (eg FF Validate Case File for Jones - FF1234 - Glasgow)

 

I can use rules which split bits out of the task name to include in columns.  For example, I can have a Selling Branch Column which is built from a rule which splits the task name by separator '-' and returns the final element from the array of split values.

But I need another column which takes the SellingBranch and looks up in a MySQL table to get the corresponding region - so any of Glasgow, Perth, Dundee return the region 'Scotland' and any of Brighton, Canterbury or Hastings return the region 'South'

I have an expression rule which takes in the SellingBranch name and returns a Region Name, which it gets by first using a query rule to look up the table SELLING_BRANCH to get regionId and then using a second query rule to look up table REGION to get the regionName.

When I try to use this rule in the column definition of my Task Report, it gives a blank column.  I can't find any documentation to say whether this ought to work or is a restriction (Appian 17.1)

 Discussion posts and replies are publicly visible