Modify Every Item in the List Field

Hi, everyone:

This is what I have:

  • A data type called Users
  • A field within User called Upcoming Events. This field is a list of texts describing the user’s ticket type for upcoming events this user plans to attend.

When a particular special event (an item from the Upcoming Events list) is removed from Upcoming Events, every remaining ticket type on that list needs to be modified. Specifically, the last 3 characters of every item in that list of text descriptions need to be changed.

Make a change to a list of things seems to change a list at the data type level, which is not what I looking for. Then I went through all the list operators (add, …, clear list), but none of them seem to do what I need to do either. Is there a trick I have neglected to think about?

Thank you.

You can do this:

This would remove the one you want then do a find & replace on the remaining ones.

But this database structure sounds like not the best way to do this… are you at the stage where we can change how this is structured?

1 Like

How would you restructure this?

I’m just taking a guess that it needs to be restructured just because a list of texts is hard to work with + working with a list of texts means they are just text, no relationship in the database with another datatype :laughing:

Is the end goal to have a list of recent events a User is attending? Is there already a Ticket datatype containing a User field and an Event (another datatype) field?

When the ticket needs the last 3 characters of the description updated, is that to indicate a status change?

It’s close. Here’s more info on what I have:

  • A data type called Users (which includes the Upcoming Events list field)
  • Another data type called Events. This includes all events the organization will be hosting this year. Each of these events have 6 ticket types depending on whether a User is a member or not (3 types for members; another 3 types for nonmembers).

A nonmember can decide to attend member orientation and register for another event at the same time (so his Upcoming Events list would include the member orientation and the event ticket type for members). However, if he later decides that he doesn’t want to become a member after all, then all the tickets that he has already registered for need to change from member tickets to nonmember tickets.

I hope that makes sense.

Yea I think I get it :thinking: Of course if what you have works then you could keep it, by adding another datatype that could help in future like adding more fields per Ticket

You could have a Ticket datatype with fields User, Event, and Status (Option set Attending, Cancelled) and Type (Option set Members, Non-members?)

Then to view any events a user is attending you do Do a search for Ticket with the constraint User = Current user and Status = Attending then do :each item's Event

Then to re-create what you asked originally you can set a ticket’s status to Cancelled, then Make changes to a list of things and search for other non-cancelled tickets and set their type to Nonmember?

For history purposes too you can track cancelled tickets instead of just removing some text from a text list field.

Wow, thanks.

How did such an easy concept become so complicated? haha.

1 Like

I will definitely take your recommendation into consideration.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.