Usersettings in "condition to check" when using branching with bots

I’m trying to guide my bot to different templates based on the language the user selected in the usersettings menu.

My first guess was the obvious : USERSETTINGS([Preffered Language])="Dutch"
So this formula lives in the “condition to check” section of the branch menu.
image

But this returns : Function ‘USERSETTINGS’ should have exactly 1 parameters, the name of an option from the user settings.

Are usersettings not available to use in bots or am I missing something obvious again?

Thanks!

Yep.

change to

USERSETTINGS( "Preffered Language" ) = "Dutch"

i.e. quote, not square brackets.

1 Like

Unable to find column ‘_THISUSER’, did you mean ‘User’?

This is what I get in return

image

Attn @Dan_Bahir

Oh. Bots are run by the server and thus don’t have access to USERSETTINGS, I believe.

1 Like

Any workaround I could use to get this to work?
I don’t see a way to log the language to the sourcedata as multiple people with different languages could be viewing the data at the same time.

You can implement your own user settings table. Then in the record the Bot is triggering on, have a “created_by” column, auto-filled by USEREMAIL() (this is a smart thing to do for every Table actually). Then the Bot can lookup the language preference by the recorded user email.

3 Likes

I found another way I think.

At the event level the usersettings are accepted as a condition.
So instead of 1 bot branching out I just have to build 20 bots.

If that doesn’t work out in the end I’ll try your option.

1 Like

I highly recommend building an users table, it’s very userful, and it’s a lot less work than building a bot army.

1 Like