How to set same bulk search order in two paragraph search field ?

In bulk search, like we searched 3id's (lets say 8,2,6) in one bulk search paragraph. Now in bulk update function, order of selected searched id's should be same like ( 8,2,6) same as bulk search.

It should not be in any other order like (2,6,8) ,(8,6,2) or (6,2,8) etc. So how can we achieve this. Please suggest

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    Hi Vishwas, for searching any multiple values in the data, you can use "wherecontains()" but this will sort the indexes in increasing order.
    So here you need to use a "forEach()" to separately search the items one by one in the array or data. Like the below pasted image.



    a!localVariables(
      local!data: {1,2,3,4,5,6},
    a!forEach(
      items: {3,1,2},
      expression: wherecontains(
        fv!item,
        local!data
      )
    )
    )


    Note: Here I am assuming that you are searching the IDs in the array. As there is nothing in Appian as bulksearch() or bulk search paragraph.

  • +1
    Certified Lead Developer

    a!localVariables(
      local!data: {
        a!map(id:1, value: "A"),
        a!map(id:2, value: "B"),
        a!map(id:3, value: "C"),
        a!map(id:4, value: "D"),
        a!map(id:5, value: "E"),
      },
      local!ids: {3, 1, 5},
      a!forEach(
        items: local!ids,
        expression: displayvalue(fv!item, local!data.id, local!data, null)
      )
    )

  • Hi Tushar

    Thanks a lot for your response.

    Here bulk search means, you are searching multiple id's/name at a time. Please read the below scenario

    There is two bulk search field. now suppose I have searched three id's at a time in one search field lets say (y,x,z). Now these 

    id's will be visible in grid. When I'll select all three id's from grid, the link will be active for second bulk search field. When i'll click

    on this field ,second bulk search field will be visible with selected id's from first field. Now I have to set the same order of id's 

    which was in 1st search field. which was (y,x,z). 

    so how can I achieve this?

  • Hi Stefan

    Thanks a lot for your response.

    Here bulk search means, you are searching multiple id's/name at a time. Please read the below scenario

    There is two bulk search field. now suppose I have searched three id's at a time in one search field lets say (y,x,z). Now these 

    id's will be visible in grid. When I'll select all three id's from grid, the link will be active for second bulk search field. When i'll click

    on this field ,second bulk search field will be visible with selected id's from first field. Now I have to set the same order of id's 

    which was in 1st search field. which was (y,x,z). 

    so how can I achieve this?