Using relationships in local variable

Certified Associate Developer

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

  Discussion posts and replies are publicly visible

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

  • 0
    Certified Associate Developer
    in reply to ajhick

    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

  • 0
    Certified Senior Developer

    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.

  • 0
    Certified Associate Developer
    in reply to GopalK

    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