Custom field value mirror to linked card
Asked by Keith:

Hi all,

Has anyone managed to do this?

Specifically after mirroring a custom date field when its changed from child to parent or parent to child if either is updated.

Thanks in advance!


Answers:
author: Iain Dooley
body: [@Keith](/t5/user/viewprofilepage/user-id/4077583) Hmm I tried this but it doesn't work:

```
when custom field "Mobile Number" is set, find the first card linked in the attachments, lookup a card with link "{triggercardlink}", and set custom field "Mobile Number" to "{{%Mobile Number}}
```

I thought that you might be able to look up the card to get a reference to the custom fields on it and set the value on the found card but doesn't look like it.

This Trellinator function will do it:

<https://gist.github.com/iaindooley/a4c37292a1db16ddf5d40afdf136ca7c>

You can read more about Trellinator here:

<https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Introducing-Trellinator-Automate-Trello-with-Google-Apps-Script/ba-p/925271>

comments: author: Keith
body: thanks I'll give Trellinator a go


author: Keith
body: looks like i've hit a rate limit. Can I control this?


author: Keith
body: And I've noticed a lot of updates, can we tweak this?

In a day I've gone through all of my monthly allotted Trello "command runs"


author: Iain Dooley
body: [@Keith](/t5/user/viewprofilepage/user-id/4077583) hey, congrats on getting it set up :) regarding the updates I think the issue might be that the cards are reciprocally linked, so each time it updates one it updates the linked card and then goes around again, you can trigger only when it's not the Trellinator user that updates, here's a tweaked version:

<https://gist.github.com/iaindooley/a4c37292a1db16ddf5d40afdf136ca7c>

However if you set this up under your own Trello api key/token that would preclude it from working when you change also. That "notTrellinator()" method is most useful when you have created a separate bot account.

Regarding the rate limit, you might find that once you add the "notTrellinator()" call you don't hit the limit anymore, but if you do then you can always just put a:

Utilities.sleep(1000);

in. I sometimes have to do that if I'm running a thing that, for example, imports a spreadsheet into custom fields because the custom fields API is so HTTP API call heavy.

If you have Butler commands triggered on custom field updates then having the thing bounce back and forth between reciprocally linked cards is probably what caused that, if you prevent it from triggering when Trellinator makes the change, that'll stop it from exhausting your Butler commands. Note, though that Trellinator isn't constrained by the same Butler quotas, it's only constrained by Google Apps Script execution quotas (which are very very large by comparison) and the API rate limits which are pretty generous; I rarely run into them unless I'm doing the aforementioned spreadsheet import.

Sorry I should probably have grokked that you were going to have reciprocally linked cards and realised that the code needed to avoid triggering itself :(


author: Keith
body: Thanks for that I'll give that a go.

I think I'll need to wait a bit. Where is this coming from Google Apps or the buffer on AWS?

function: setCustomFieldValueOnLinkedCard Exception: Service invoked too many times for one day: premium urlfetch.","Now coming to Global Commands..."\]


author: Iain Dooley
body: [@Keith](/t5/user/viewprofilepage/user-id/4077583) that's coming from Google apps Script, it'll reset in a few hours, that's just due to the same thing, it was bouncing back and forth off itself and exhausted Google's quota. No worries though it'll just reset and start working again, however you might want to go into the ExecutionQueue sheet and clear out all the notifications, it'll bank them all up and retry them all once the quota resets otherwise


author: Keith
body: Sorry [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112) but the rejigged function doesn't seem to work. Would you mind double checking that it is correct?


author: Iain Dooley
body: [@Keith](/t5/user/viewprofilepage/user-id/4077583) 2 things:

1) Are you still seeing the "Service invoked too many times for one day" error? It won't work until that stops happening :)

2) When you set this up, did you plug in your own API key/token? If so, then the bit that says "notTrellinator" is telling it to ignore any action that you take. In order for this to work you'd have to have Trellinator running as a separate "bot" user


author: Iain Dooley
body: [@Keith](/t5/user/viewprofilepage/user-id/4077583) oh, also I just took a look at the code and saw that it wasn't setting the variable "changed". Also it's better to check for a changed custom field before checking that it wasn't Trellinator that took the action, it'll use fewer API commands, here's another edit:

<https://gist.github.com/iaindooley/a4c37292a1db16ddf5d40afdf136ca7c>


author: Keith
body: Thanks [@Iain Dooley](/t5/user/viewprofilepage/user-id/1416112) working nicely now