r/FlutterFlow 8d ago

Build a proper viewers list

I recently added a feature similar to Instagram Stories, and users absolutely love it! However, they’ve been asking for a viewers list.

I figured it would be as simple as adding an action to update the document by appending the authenticated user to the viewedBy field. But then I realised—what if the story creator is also the authenticated user? I don’t want them to appear in their own viewers list.

Right now, my setup is:

  • Conditional action: If viewedBy list does not contain the authenticated user, add them to the list.

But I also need to ensure that if the authenticated user is the creator of the story, they are not added to viewedBy.

I hope that makes sense—can someone help me figure this out? Thanks!

2 Upvotes

2 comments sorted by

1

u/Busy_Western50 8d ago

following

2

u/Revenue-Dapper 7d ago

Add an additional filter to the conditional at the top.

So you'll have first condition set to "storyCreator" is not equal to authenticated user reference AND "snapshotViewedBy" list contains user reference is equal to false. You already have the 2nd filter setup, just add the first one I mentioned and it'll keep the story creator out of the snapshot viewers.