Index Function ,with a selectable grid

hey! i am working with a selectable grid , when i select a row , i want to show one of the fields (currency) in in an intFeild, but the currency value is taken from another table(Currency Table), and then called using the relationship between the (Account) and the (SKJCurrency) tables, how do perform that using the index function, I tried using index twice but that didn't work. 

If using two index is not possible , how should i do that ? and what's the right synatx , i cant find any exampls and i need to fix this issue asap.

/*The Grid field where i called the currency table*/
                  
                    a!gridColumn(
                          label: "Currency",
                          value: fv!row['recordType!{e54cd4e6-9c62-49a2-82d6-965f3a86b2e7}SKJ Account.relationships.{a0795917-dbcb-4e87-8928-253944204ea6}skjCurrency.fields.{de6af13f-a763-462f-9369-8cd8bbbf1075}descAr']

                        ),
                  
                  /*The int Field where i am trying to display the value*/
                  
                  a!integerField(
                    label: "Currency Code",


                 
                    value: index (index(local!selectedEmployees,1,"null").skjCurrency,1,null).id,
                   
                    
                    
                    saveInto: ri!record['recordType!{2206daff-ddbb-4759-a797-1588754c3925}SKJ Deposit Request.fields.{02f7c877-9193-4f52-a586-f47589fcccba}currencyCode'],




                    required: false
                  )

thanks

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    This seems to be a duplicate of community.appian.com/.../selectable-grid

    Any particular reason why you are using index instead of dot notation?

    a!localVariables(
      local!selectedAccount,
      local!accountData: {
        a!map(
          accountId: 1,
          description: "Has currency with description",
          currency: a!map(id: 1, descAr: "Current description")
        ),
        a!map(
          accountId: 2,
          description: "Has currency with null description",
          currency: a!map(id: 1, descAr: null)
        ),
        a!map(
          accountId: 3,
          description: "Has currency with no description field",
          currency: a!map(id: 1)
        ),
        a!map(
          accountId: 4,
          description: "Has no currency value",
          currency: null
        )
      },
      {
        a!gridField(
          label: "Read-only Grid",
          labelPosition: "ABOVE",
          data: local!accountData,
          selectable: true,
          selectionStyle: "ROW_HIGHLIGHT",
          selectionSaveInto: {
            a!save(
              local!selectedAccount,
              /* cast to single item rather than a list */
              cast(
                typeof(a!map()),
                fv!selectedRows
              )
            )
          },
          columns: {
            a!gridColumn(label: "Account", value: fv!row.accountId),
            a!gridColumn(
              label: "Description",
              value: fv!row.description
            ),
            a!gridColumn(
              label: "Currency",
              value: fv!row.currency.descAr
            )
          },
          validations: {}
        ),
        a!textField(
          label: "Selected Currency",
          readOnly: true,
          value: local!selectedAccount.descAr
        )
      }
    )

Reply
  • 0
    Certified Lead Developer

    This seems to be a duplicate of community.appian.com/.../selectable-grid

    Any particular reason why you are using index instead of dot notation?

    a!localVariables(
      local!selectedAccount,
      local!accountData: {
        a!map(
          accountId: 1,
          description: "Has currency with description",
          currency: a!map(id: 1, descAr: "Current description")
        ),
        a!map(
          accountId: 2,
          description: "Has currency with null description",
          currency: a!map(id: 1, descAr: null)
        ),
        a!map(
          accountId: 3,
          description: "Has currency with no description field",
          currency: a!map(id: 1)
        ),
        a!map(
          accountId: 4,
          description: "Has no currency value",
          currency: null
        )
      },
      {
        a!gridField(
          label: "Read-only Grid",
          labelPosition: "ABOVE",
          data: local!accountData,
          selectable: true,
          selectionStyle: "ROW_HIGHLIGHT",
          selectionSaveInto: {
            a!save(
              local!selectedAccount,
              /* cast to single item rather than a list */
              cast(
                typeof(a!map()),
                fv!selectedRows
              )
            )
          },
          columns: {
            a!gridColumn(label: "Account", value: fv!row.accountId),
            a!gridColumn(
              label: "Description",
              value: fv!row.description
            ),
            a!gridColumn(
              label: "Currency",
              value: fv!row.currency.descAr
            )
          },
          validations: {}
        ),
        a!textField(
          label: "Selected Currency",
          readOnly: true,
          value: local!selectedAccount.descAr
        )
      }
    )

Children
No Data