Question with adding tooltip to each of the ID in a text string of ID

Hi everyone, 

My read-only grid has a column storing a text string of IDs, which looks like this 001/002/003/004/005/006, and it was queried from record type 01

I want to add the tooltip, which will show the Client category of each of the ID in the list, the information is stored in record type 02, and I use the ID from record type 01 as reference data to query. So within richTextDisplayField, I set the tooltip parameter like below: 

tooltip: a!forEach(
                    items: split(
                                fv!row[recordType!record01.Id,
                                 "/"
                             ),
                    expression: "Category:" & 
                                a!queryRecordType(
                                        recordType: recordType!record02,
                                        fields: recordType!record02.clientCategory,
                                        filters: a!queryFilter(
                                                        field: 'recordType!record02.Id,
                                                        operator: "=",
                                                         value: tointeger(fv!item)
                                                         ),
                                        pagingInfo: a!pagingInfo(1,1)
                                 ).data[recordType!record02.clientCategory] 
                  )

I expect that when I click each ID, the tooltip will show: Category: Abcdef, instead I got something like this photo:

 

I think it's the forEach () issue, but no idea why it's the issue... Anyone know what the reason is? 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi Molly,

    Not used this before - but my assumption here is that there can only be one tooltip for each richtextdisplay field. If you want to display the different categories, you would have to split out each into their own richtextdisplay field - why doesn't the a!foreach work before this?

    Cheers,

    Lewis

  • a!localVariables
    (local!category: a!queryRecordType(
                            recordType: recordtype!record02,
                            fields: {recordtype!record02.Id, recordtype!record02.clientCategory}
                            pagingInfo: a!pagingInfo(1,50)
                     ),
     a!gridColumn(
                label: "ID",
                value: if(
                        a!isNullOrEmpty(fv!row[recordtype!record01.Id]),
                        "-", 
                        a!forEach(
                                items:  split(
                                            fv!row[recordtype!record01.Id],
                                            "|"
                                        ),
                                expression: 
                                        a!richTextDisplayField(
                                                        value: a!richTextItem(
                                                        text: insert(fv!item, "; ", if(fv!isFirst, null,count(fv!item))),
                                                        link: a!recordLink(
                                                                        label: fv!item,
                                                                        recordType: recordtype!record01,
                                                                        identifier: tointeger(fv!item),
                                                                        openLinkIn: "NEW_TAB"
                                                                )
                                        )
                                ),
                                        tooltip: concat("Category:",
                                                                        index(local!category, wherecontains(fv!item,index(local!category,"Id",null)),
                                                                       "categoryName",{})
                                                                )
                                                )
                    )   
                   ),
        sortField: recordtype!record01.Id,
        align: "CENTER"
      ),  
    
     

    I tried using forEach() infront of a!richTextDisplayField but all the IDs was replaced by stranged strings like this:

     

  • 0
    Certified Lead Developer
    in reply to mollyn126

    a!localVariables(
      local!category: {
        a!map(id: "001", category: "Category 1"),
        a!map(id: "002", category: "Categiry 2"),
        a!map(id: "003", category: "Category 3"),
        a!map(id: "004", category: "Categiry 4")
      },
      local!data: { "001/002/003/004", "001/002/003/007" },
      {
        a!gridLayout(
          label: "GRID",
          headerCells: { a!gridLayoutHeaderCell(label: "data") },
          columnConfigs: a!gridLayoutColumnConfig(width: "ICON"),
          rows: a!forEach(
            items: local!data,
            expression: a!forEach(
              items: split(fv!item, "/"),
              expression: a!gridRowLayout(
                contents: a!richTextDisplayField(
                  value: a!richTextItem(text: fv!item, ),
                  tooltip: concat(
                    "Category: ",
                    index(
                      local!category,
                      wherecontains(
                        fv!item,
                        index(local!category, "Id", null)
                      ),
                      "category",
                      {}
                    )
                  )
                ),
                
              )
            )
          ),
          
        )
      }
    )

    Can you help me with the data you are getting when you query the record? 

    Do you want an individual tooltip for each item or a combined tooltip ?

Reply Children