Skip to Main Content
Status Started
Categories Form Designer
Created by Guest
Created on Jul 13, 2023

At Form, get Nth-Item from collection variable

When we use the value of the collection variable at Form,

we need to export the item with "get Item from collection" and set it as each individual User define variable.

It is very inefficient and make variable list too long.

If there is a function like getNthItem in form variable, needed effort will be significantly decreased.

  • Attach files
  • Admin
    Chintan Desai
    Reply
    |
    Jul 31, 2023

    Hi Juyoung, are you able to help me understand a couple of user scenarios for this function? We are planning to expand on the collection operations so you rinput will be very helpful. Thanks

    1 reply
  • Guest
    Reply
    |
    Jul 13, 2023

    Hi,
    you can use the "Replace" function with some Regx as following example:
    replace([Form].[rsREGX],"^(?:[^,]+,){"+convertToString([Form].[Row]-1)+"}([^,]+).*", "$1")

    this code is using a regular expression to extract a specific portion - in your case the Nth-item of a string/Collection based on the provided pattern and replace the entire string with that extracted portion, so basically it extract and Get the Nth item from collection.
    Hope that help,
    Thanks,Majid

    1 reply