CreatedBy filter not working. Name not being saved to createdByName column.
I'm using v1.1.1 and the "created by" filter does not seem to work. I have tried this with opportunities as well as notes. The filter returns no results even if the correct name for "created by" is added.
A separate question, is it possible to filter by a custom field? E.g. if I create a custom field, is it possible to use that in a filter?
20 Replies
Hi, I've checked on newest version and looks like "created by" filter works as expected, could you upgrade your instance to newest version and re-check if you are able to reproduce the problem?
About filtering by custom field, it is possible to filter records by said field.
Hi @bob this is good to hear, let me upgrade to the latest version and re-test. Will let you know if successful.
Hello again @bob , I've updated to v1.2.1 (self-hosted on docker) and the created by filter still does not work. Please see these screenshots.
In the notes area, I filter using createdby contains "dianah" but no results found even though there certainly is a note created by that person.
Perhaps there is something silly I have misunderstood here...but hope to get some guidance.


That's weird, the only reason I can think of why this would happen is because of different Unicode characters so even if this looks the same, under the hood they have different codes 🤔
Since Twenty uses GraphQL to fetch records, could you check what does this query returns in GraphQL API?

Thanks for the response. Using the browser inspection tool, I'm attaching the request being sent to the GraphQL endpoint below. I don't see any special characters being set in the payload.
If it helps, the headers in the request are application/json and charset=utf-8....my browser locale is also set to
en
(English)Update...I've just checked what the API returns when fetching all the notes...interestingly, all the createdBy values are just " " (empty string)....so this is getting me closer to the root cause.
The next question would then be: what would cause createdBy to have a blank string for the name? Example createdBy object being returned is below.
My bet is data loss due to bad migration (even though console shows everything has been migrated properly, there was something wrong but never reported) after upgrading or said member has deleted their account (there was a related bug to it but I think it's non-relevant to your case).
Is this member properly visible in Settings > Members? What does API return when you run query below? Also, what does database return when you run this query
select * from workspace_{id}."workspaceMember" where id = 'd7cde816-fc82-4470-bea1-517a0563886f'
?
Thanks for getting back to me. I'm looking at the tables in the DB and under the
company
, note
and people
tables, the createdByName is empty. A fresh install of v1.1.1 is where I began before upgrading to v1.2.1
On the fresh install of v1.1.1 the dummy records that are usually created do have the createdByName populated with System
which is expected I guess...but every record created after that has an empty createdByName regardless of the user's role. When going to Settings > Members all accounts appear correctly (names are showing) and the user I am testing with has definitely not been deleted.
I'm quite doubtful that this is due to a bad migration because the filter has not been working since I fresh installed v1.1.1
As a side note: What's a good way to find the workspace ID? I only have two workspaces but if more are needed later it would be good to know how to inspect the ID of a particular workspace...

What's the name of this DB visualizer? DBeaver?
Yes
Took me longer than I expected due to weird problems, sorry for that
Basically, you have to connect to
default
database, once you open schemas
, there's the ID of workspace (mine are seeded)
To connect to default database, you either have to change the name of database or check "Show all databases" checkbox

Thanks for this...I've spotted the above as well on my side.
What remains a mystery to me is why this createdByName field is not populated. I've tried creating new records but the behaviour persists.
I also upgraded my local instance of twenty to v1.2.1 and I'm able to reproduce the problem locally as well.
I believe createdByName is taken from workspace_{id}."workspaceMember" table so if there's a record with empty first and last name, that would explain the reason behind this
Update: createdByName is not taken, it's simply duplicated so even when workspace Member account is deleted, creator's data won't be lost

I appreciate you getting back to me. I've checked the workspaceMember table and the
nameFirstName
and nameLastName
values are not empty. The name reflects properly there.
I've gone as far as to create an account on TwentyCRM cloud version and the createdBy field there seems to be even worse. The name won't even get captured when I create a record. There is something wrong with how createdBy is being captured and the problem is in the code.

I'm reproducing this issue, congratulations on finding a bug! 😄
I've reported this case here https://github.com/twentyhq/twenty/issues/13579
GitHub
Records created without creator · Issue #13579 · twentyhq/twenty
Ticket from Discord: https://discord.com/channels/1130383047699738754/1400780784377266217 Scenario: Log in Using invite link located in Settings > Members, create new account While being logged ...
Thanks for confirming the bug. I was able to find out how to filter by custom fields so that is going to be my workaround for now...but this is still an important thing to fix.
One last question if I may, when a new workspace is created, a new DB is created in the naming format
workspace_{id}
where ID is something auto-generated. Is there a place where the auto-generated ID is stored that will map the name of the workspace to the ID in the DB name?
This is what I was trying to ask previously above.From what I can see, id in
workspace_{id}
and workspace's id in core.workspace are not the same, probably core.workspace has clean id while workspace_{id}
has hashed version of it but I'm not sure where I can find it in code to confirm my hypothesis