Skip to main content
Does anyone know how we can include the current user's ID in a 'createRecord' event payload?

 

We are using the app 'Sortable Data Grids' which works well. We have an event payload when creating a new record which pre-populates a lookup field (Programme__c) with the #.parentrecordId# and this works as expected:

 

{"entityApiName":"Eth_Programme_Event__c", "defaultFieldValues":{"Programme__c":"#.parentrecordId#"}}

 

We want to also pre-populate a look up field for Users (Assigned_staff__c) so the default is the current logged in user. I've tried userInfo.getUserId() and $SObjectType.CurrentUser.Id (for example the below code) but we get an error when clicking to add a new record using this event:

 

{"entityApiName":"Eth_Programme_Event__c", "defaultFieldValues":{"Programme__c":"#.parentrecordId#", "Assigned_staff__c":"userInfo.getUserId()"}}

 

Any idea how to reference the current user in an event payload?

 

How to reference current user ID in a create record event payload

 

Many thanks!
1 réponse
0/9000