Allows you to use custom logic to determine how to remove duplicates from a list.
To use this function, you’ll need a Child FLO that calculates the value that will determine if an item is unique or not. (For instance, you may have a list of available volunteers but you only want one person for each combination of job specialty and primary language). The child FLO you specify will get invoked once for each item in the list and return a value for each item. After all of the items are assigned values, a new list is constructed with only one item for each unique value.
Define fields on the event card that will be the inputs that are required to determine the unique value. Typically you will include a field for the item of the list, i.e. if the list is a list of text then one of the inputs should be a string. You can also include as other inputs whatever your FLO will need to calculate the sort value. If you need to know the position of the current item within the list, use the “Index” field from the Context section of the child FLO card. Then build the rest of the child FLO, ending with a Return card that returns a single value. The name for the value on the Return card doesn’t matter. Save the FLO and turn it on.
Now go back to the Unique Custom card, input the list you want to remove duplicates from, and then select the FLO you just built. The inputs will auto-populate, then you can map data into them. To map an input to accept each item of the list, click in that field and you will see a dropdown that includes Item – select that. Or if your list is a list of objects, you may also see the schema of the object, i.e. the keys that it contains, and you can also build your child FLO to accept those as inputs. In addition, you can drag in outputs from previous cards in the FLO – in that case, the same value will be used for each item in this list.
- list: The input list that contains duplicates you want to remove
- flo: The child FLO that will be called once for each item in the list
- with the following values (dynamically generated): The inputs defined by the child FLO – these will populate after you select the child FLO using the Choose FLO dialog
- concurrency: The number of items in the list to process in parallel. If it is important that the items are processed in sequence, use 1. Otherwise a higher number like 5 or 10 will cause your FLO to complete sooner.
- list: The output list that contains only one item for each unique value returned by the child FLO. The type of output list should be set to match the type of the input list (e.g. list of text or list of objects).
- You have a list of text:
- You create a child FLO that accepts a text input and returns the length of the text
- For the text input to the child FLO, you click and choose “Item” from the dropdown
- The output list will be:
["a","is","this"]– only one word of each length.