Hello again guys,
Currently setting up a router with 2 routes - Either the contact exists already, or it does not. The module where the contacts are stored is Teamleader, our CRM system.
I have a problem with updating the contacts. If I update a contact, obviously I don’t have to map the first name, last name or other regular fields again, since most of them already contain the correct data.
But when I want to add tags, it does add the new tags that I assign. But the old tags that the contact had, are removed. I tried a few times to keep the old tags, using the ‘Tags’ field from Teamleader itself. Unfortunately this action combines all the existing, old tags into 1 tag. Obviously useless and not working. Also the ‘[1] Cultivation/Growing tag’ is just one tag showing up, while the actual contacts holds 2 tags already. I could insert those numbers [1] [2] in each tag field, but then the problem is that some existing contacts might contain 4 tags, Make will never give me 4 of those [tagnumber] fields.
How do I keep old tags that were already in Teamleader in it’s place and untouched?
Thanks for your help, check the screenshot below for context.
In the Tags field, turn on the “Map” toggle.
Then, you can map an array of tags in the field: {{6.tags}}
To add additional tags, use the add
built-in add
function:
{{ add(6.tags; 4.interestedIn; 4.formName) }}
samliew – request private consultation
Join the Make Fans Discord server to chat with other makers!
2 Likes
Hi @Bamboologic,
Know that updating collections (tags in this case) via Teamleader Focus API empties the collection and replaces it with the new value: https://developer.teamleader.eu/#/introduction/general-principles/collections
Updating collections
Collections are replaced entirely during updates, so all the wanted values should be provided when updating entities. Other existing values which are not provided will be removed.
So if you want to add new tags, you should add the old array and merge the new values in to it.
If you have any Teamleader Focus related questions, I am available as certified Teamleader partner and Make Partner.
Cheers,
Henk
2 Likes
That’s the thing, when I add that {{6. tags}}, It will add all those tags into 1 tag. Which makes a mess of the customer database. How do I seperately keep the old tags? Same question to you @Henk-Operative ; I can add the old array in the list of tags, but it WILL put ALL the old tags into 1 tag. How to prevent this. There must be a way right?
Otherwise the function to update a contact is not fully functional, if it would just overwrite the old tags, or put the old tags into 1 tag…
another thing I noticed:
I tried to manually add a bunch of tags in Teamleader, to check if Make recognises those tags that are attached to the contact in Teamleader. Unfortunately it always only gives 1 tag…
Then I tested to add the tags with the map fucntion enabled, but this just messes up everything, it combines the tags into 1 tag, see screenshot below. EDIT: I see that i didn’t use the ; symbol - But it still merges the tags if I use that symbol
But this still leaves me with the other merge problem from {{6. tags}}
@Bamboologic Mind you that you are passing the tags as a string:
Therefore, Teamleader Focus replaces the Tags with a new array that contains only the one string value.
You can either not use the Map function and give in each tag as a separate item, or use the Map function and pass an array.
Let’s say you are updating the contact, you take the original Tags array and add the values you want to add with this function:
{{add(oldarray; "newtag1"; "newtag2")}}
Feel free to contact me for a personal consultation: Contact | Operative
Cheers,
Henk
Okay. But if I take the original Tags array, it will merge those original tags into 1 tag.
Imagine 1 person signing up through 3 different forms which result in 2 times being updated as a contact. 2 times in a row the old tags will be merged into 1 tag. It will completely mess up organisation and structure in contacts and in Teamleader tag database itself.
How to solve this?
For example, this is what happens basically, we can’t have a tag that looks like this…
This is what should happen:
2 Likes
I did not use the ‘Get a contact’ ,module yet. If my logical thinking is right, should I insert this module as in the screenshot below? Would this fix that problem that the tags array merges all the tags?? Also this module seems like not needed in my scenario, since I already fetch the contact (if existing) based on an email adress search ([equal to] filter).
Or is there something wrong in general with my tags settings (2nd screenshot to check)
It’s working. Thank you !!
1 Like
Yes indeed, Update modules only send data. (generally, depends on how the app was built in Make).
So in order to enrich data, you first have to Get it, merge it and then Update it.
Happy to read it works!
Cheers,
Henk
1 Like
I did not insert a Get module in the end. Does this mean it’s going to end up doing the same thing again? Cause I tested it and I believe it inserted the tags seperately… (which is what previously was the problem that that did not happen)