Need help in preventing removing array data saved in array column and rewriting it with new selected items

Hi Guys,

Hope you had a great weekend!

I need help with an issue I am facing in Array

I am selecting few creators from creators table and writing them into Multiple files column in my users table.

One pressing of Button called Copy I am writing this multiple files into an Array in my campaigns table.

My Issue

When I clear the selection in UI and then click on COPY to a campaign, the already present creators are getting removed

**Another scenario **

If I have seleted Creator A, Creator B and copied them to campaign 1

If I press on Clear button and clear selection and then Select Creator C and Creator D and press copy to campaign 1

A and B are removed and C and D are added

In creator Table I have Array column which has Row ID and selected creators incuded

My Copy action configured is over writing the present values with New values, Any idea how I can prevent the overwriting? without having to create more columns?

Is there a way I can keep the previous selections and add the new ones selected?

Thank you in advance for the help.

Regards,
Dilip

I think you need a template column in between which joins the existing creators with the new ones… then when you set column value use the template column.

Hi Eric,

Thank you for the reply. I thought of this approach.

I think doing that would mean I would have to create definitive number of columns, as I would not know how many time will I add more extra creators.

So I am thinking it is not a good approach?

Not sure wether its a good approach, Can you advice.?

Regards,
Dilip

What if you add a Boolean column “is clicked”… then an ite column… if bool is true then creator → else blank.

Then add a joined list and target the ite column. Use that joined list in your template

Might need to see a short video to better understand…

Hi Eric,

I dont think that will work my case would be

  1. I add Creator A and Creator B first and then copy it into array

Then I clear all selected values by clicking on clear all

I select Creator C and Creator D , When I copy the selection to array it’ll remove A and B and only keep C and D

Did not understand how having a boolean will help in this.

Can you explain but more?

Regards,
Dilip

Ahh you are using the multiple files column. You need to use a make array column in between. The make array column should have your existing creators plus the new creators. When you set column value you should be using the make array column to replace.

Is this on a detail screen? in a form? any screenshots would be helpful.

1 Like

:point_up_2: Make array column

Hi Eric,

My first Make Array column is in my creators table.

I store the creator ROW ID for selected along with the present row ID here

Then I move it to User table by creating aMultiple Files column, to store the selected creators ID by using a relation

Then When I click on Copy button to copy creators I create a Multiple files column to move the selected creators into this multiple files column in Campaigns table

Are you saying the last column in Campaigns table should be changed to Make array?

Its a collection Listview

Regards,
Dilip

Hi Himaldin,

Thank you for replying.

I have shared a few screenshot above.

So the column where I am storing the selected Item is Multiple file column. Are you saying I should convert that to make array?

Regards,
Dilip

Hi Eric,

Thank you for replying.

I have done exactly that in my creators Table

Its working as expected when saving values in user Table column.

Issue is when I Copy it to move to campaigns Table.

The Multiple files column there is removing the previously added items.

Example: When I add 2 creators to campaigns table Multiple Items column

A and B its is fine

Next time when I clear all my selection in creators table and Add C and D

It removed A and B

But adds C and D

In campaigns table. , I am assuming its because the instance to A and B are removed from selection because I cleared it, How do I solve this.

Ideally I would want A and B which were copied previously also to be there along with C and D .

Its important that I have clear functionality too, Because I might be dealing with 100 of campaigns.

Regards,
Dilip

Your case has been discussed before, exactly like Robert’s video.
If you watch the video, then you know that for the action of adding or subtracting, it only requires 2 tables and one of the tables must be a user table.
However, if you have a third table, that is another unrelated issue.
Your third table is only for following/taking data from the existing array and can be returned to a regular list if you want.

I understand what you are telling, That’s as per the video Demo of Rob.

They are not using the third table, In My case I am taking the values from User table and storing it in a 3rd table.

In my case yes I do have a 3rd table which I store the values

But writing values to this table for the same campaign can happen multiple times.

Like first time I might add A and B

next time after working on other campaigns I might come back and add C and D again

and then again after adding multiple campaigns I might add E and F again.

I would want A, B , C D, E and F all to be there.

I understand that. but is there a way I can alter my 3rd table to get the previously selected items as well for the particular campaign?

How would I be able to do it? I mean I cant take values directly from user table because it will only hold New creators selected in my case.

I would have to do something in Campaigns table.

Regards,
Dilip

The addition action will continue to increase as long as you do not remove it, right?

If you mean to display only for a certain period, then you can add a timestamps column, so that through the filter you can display only the last campaign limit you want.

Yes You are right, it will keep all data and adding new data unless I dont remove it from the List

No I would want to it to be displayed till I remove items.

Is this something that can be achieved by doing something?

Regards,
Dilip

I’m looking at your table again, and I’m confused about what the problem is now.

  1. In your Campaign table, you already have a relationship column, enough to display the creator on the screen.

  2. You can add a new relationship column in the creator to display campaigns based on the creator on the screen.

I am sorry if you got confused because of my wordings.

My problem

When I select creators from Creators table (using Make array column) and Add them to user table (multiple file column)

It works fine.

Let us say I selected A and B

Now in my front end I have a Copy button and dropdown which lets me select campaigns present, When I press the copy button after selecting campaign name from dropdown it sends the Values in user table (Multiple file column) to campaigns Table (multiple files column)

Refer below screenshot

Yes Now I can show the copied creators using the relation.

If you see you also have a reset button at the top in the screenshot I have shared, which resets all selection meaning it empties the multiple file column values in User table.

Now Imagine I have selected some other creators from list and moved them to other campaigns.

I have now come back to this List which I am showing currently in screenshot, I will click on reset button because I need the flow of reset to remove all creators from list in the present screen

I click reset which removes all selections from selected state

Now When I select Let us say C and D, and click copy, it removed A and B and puts only C and D into the campaigns table for this particular selected campaign.

How can I ensure that Previous selected values and the new selected value for this campaigns is sent when I click on Copy?

Did this give better clarity and clear doubts?
Let me know
Regards,
Dilip

Hi Himaldin,

Hope I didnt confuse you more.

Regards,
Dilip

It looks like you’re using bulk actions. Are you working within a form and how do you do it? I can’t give advice without trying it on my computer.
However, in principle, your ‘copy to campaign’ and ‘reset’ buttons should be “adding” and “removing” arrays as discussed above.