How to reset a data lookup

I try to make a generic page (followed by a flow part) that is called in two ways:
1: With a single data item (put in a list via a lookup)
2: With a list of data items (created via a lookup)

So, the purpose is to have a generic page/flowpart that works on both a single item as well as on al list of items. Therefore I would like to decide which one of the two to use and continue with that one.

Now I notice that the lists created with the lookup remain valid while in the userflow. As a result, the above works only the first time in the userflow.
I have no way to distinguish between the two of them. Unless there is a way to ‘reset’ a data lookup.

(A work around would be to work with a boolean flag to indicate which one should be used, but that will use unnecessary logic I think)

Any ideas/help would be appreciated!

1 Like

Hi Marcel,

Welcome to the Triggre community! Thanks for posting your question. Let’s see if I can be of help :slight_smile:

When I run into this situation myself, I always do the following:

  1. Make a flow part with 2 inputs; a single data item and a list of items.

  2. Use a calculation action as the first action in the flow part, and use the List - Combine A with B function. This will allow you to combine the single item and the list.

  3. In subsequent actions you can just use this combined list and all your logic will work for all items in the list, including the single item.

This trick allows you to use the flow part with either a list, or a single item and even both.

If somewhere in your logic you need to know where you supplied as an input a list and/or a single item, you can simply check the inputs for being empty.

Hope this helps!

Hi Jesse,

Many thanks for the quick answer and the clear ‘trick’!

This will work fine except (if I am right) the user stays in the same user flow and enters the flowpart again but now with the other input provided. It appears to me that the previous input still has the (old) value…


Hey Marcel,

That is correct. If you want to use a different value, that the user selects on the page for example, then you will have to make that page submit that value to the flow part or you need to store the value you want to use in the user data item (so you can get it from the current user in the user flow).

Hope this solves your puzzle :face_with_raised_eyebrow: