Hi Stacker Team, I'd like to know if there's a way...
# questions
w
Hi Stacker Team, I'd like to know if there's a way to get the UserId so I can add it directly into my Stacker formula? The formula as seen in my picture (a webhook for Make) is not in the user table, so I cannot get the UserId. It would be like "As I am currently using the app, so here is my record ID".
s
Hi Camille, using the Record ID should look like:
RECORD_ID()
Let me know if this helps or if you still have questions about the setup!
w
In my example, if I add
RECORD_ID()
to my formula, it would be the record ID of the related calendar_date record line, not the user clicking on the link. I understand it might be tricky though to get it. It's like "I autofill the formula with the UserId whatever table I'm on if I add this to my formula"
s
Ahh got it, I misread the message! Thank you for clarifying. You would need to do this on the Users table, or create a link for each person individually. As of right now there is not a way to do this in Stacker.
Are you using Airtable as the backend?
w
Airtable is used as the backend yes, I just sometimes add some formulas or fields that are specific to Stacker directly on Stacker (to optimize space on Airtable)
s
If you can make this on Airtable, you should be able to use the linked trainer to lookup the Record ID from the Trainer (users table) then use the looked up Record ID in the formula. But you would have to make this in AT because Stacker, as of right now, does not let you use Lookups in Formulas.
w
The thing is on one single calendar day record line, we can have several Trainers affiliated, which would make the looked up Record ID filled with different Record ID. I'll try from the Trainer (User) table if I can it make it work
šŸ‘ 1
s
@worried-iron-69374 AFAIK, the only reliable way to do that is with custom scripting. Typically, in Stacker, when clicking on the button that triggers the action, it triggers a call to your make endpoint, providing the Airtable record id of the current user. That’s how I’ve done it so far. (when the user is dynamic like in your case)
w
@sticky-night-20812 That's what I was afraid of! The formula URL is indeed used to trigger a call to Make, but I'm not quite sure how to custom script it to get the UserId 🤨
s
That’s... complicated. I’ll PM you
thank you 1
w
Thank you!