Skip to main content
April 27, 2022
Question

Using relationships in local variable

  • April 27, 2022
  • 4 replies
  • 0 views

In my Appian Exercise, I have a interface where i'm getting a record of particular record type ("employee") using a rule and storing it in local variable.

a!localVariables(
local!employeeDetails: rule!EE Employee("1"),

i'm using this local variable in textfield. 

a!textField(
label: "Employee Department",
labelPosition: "JUSTIFIED",
value: local!employeeDetails[recordtype!EE Employee.relationships.EE Department.fields.departmentName],
characterLimit: 255,
readOnly: true
),

This large font coding is not fetching me value, giving null value

Please help

4 replies

andrewh0007
April 27, 2022

Can you change the value to only show local!employeeDetails and show us the result? Only if the data isn't sensitive.

April 27, 2022

yes , i have used

value: local!employeeDetails[recordtype!EE Employee.fields.empName],

This is working and giving me empName attribute value for emp id "1" from "EE Employee" Record Type

gopalk2865
Participating Frequently
April 27, 2022

Hi Madhu, Can you check if you have configured relationship correctly in your record type. If yes then try to check if you are able to see the value in the experience rule itself.

April 28, 2022

Hi, In record type i have given Many to one relationship and i'm able to see the preview of data with department table columns if i give emp id.

Tried in the expression rule as below,

a!localVariables(
local!result:
a!queryRecordType(
record details

)
},
ignoreFiltersWithEmptyValues: true
),
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 100
)
).data[1],
local!result[recordtype!EE Employee.relationships.EE Department.fields.departmentName]
)
Here too i'm getting null value as a result.
If i try to access the relationships through a rule input of Record Type, i'm able to get the related table details (department table here).
Problem facing is through local variable, i'm trying the access the related table data through local variable holding data of Record Type.
If possible try to replicate the scenario and help.
Many Thanks