Unable to lookup single record in UI builder data resource

Jamie L Douglas
Tera Expert

G'day,

 

I have spent several hours trying to troubleshoot an issue in UI Builder and was wondering if anyone can provide some tips on what I might be doing wrong.

 

I am trying to configure the attachments on the contextual sidebar for Catalog Tasks to show both attachments for Catalog Tasks and Request Items. I have created a variant of the Record page, and created a variant of the Attachment SNC sub page. I want to be able to lookup the sc_task and return the request_item table and sys_id to use in an attachment component, however, I seem to be getting an error "Invalid syntax with ANTLR error 'token recognition error at: '.g'' at line 3 column 6".

JamieD927598167_0-1737705467365.png

 

If I hard code the details into the attachment component it works fine, but I need it to be dynamic. Here is a screenshot of what I want (this is the hardcoded version).

JamieD927598167_1-1737705583598.png

 

To load the sc_task attachments, I am using the out of box variables 

@context.props.table & @context.props.sysId and this works fine. But when trying to use those same variables in the Look up single record data resource I get the error mentioned above.
JamieD927598167_2-1737705729348.png

 

I know some of you might say just create a script to copy attachments from RITM to SC Task, but its not as simple as that. My customer is using Universal Record and so there is way too much customisation to be trying to copy/delete attachments. If I use a related list to show all attachments related to the RITM and SC Task in Workspace, these are hidden in the related records tab. I convinced by customer to use Workspace but now this is a blocker for deployment.

 

Has anyone else had the error mentioned above and know of a fix or better way to achieve the outcome?

 

@Brad Tilton I have read a lot of your articles, and I did see something about gForm vs record controller. Is record newer than gForm? I can see @data.gform.nowRecordFormBlob.table being used in the page properties, not @data.record. Could this be part of my problem? I see the SRP Record page is using @data.record but i have no idea how to get this into the Attachments page!

 

I look forward to finding a solution

 

Thanks, Jamie

 

Jamie Douglas
GlydePath Consulting
Brisbane, Australia
1 ACCEPTED SOLUTION

Jamie L Douglas
Tera Expert

@Dibyaratnam thanks for the tips. I wasn't getting any results in the single lookup using @context.props.table & @context.props.sysId. What I ended up doing is creating a client state parameter, then in the body, created a page ready event mapping to set  client state parameter with @context.props.sysId

 

JamieD927598167_0-1737960626484.png

 

Then when I used the client state param in the single lookup I could log the result to console.

JamieD927598167_1-1737960708123.png

 

JamieD927598167_2-1737960747598.png

 

 

From there I was able to use the output of the single lookup to get the attachments I was after using 

@data.look_up_a_single_record_1.items.1.id

 

JamieD927598167_3-1737960789459.png

 

It only took me 2 days to figure this out.. Had fun learning about Workspace though!

Jamie Douglas
GlydePath Consulting
Brisbane, Australia

View solution in original post

2 REPLIES 2

Dibyaratnam
Tera Sage

Not sure if you have record controller data resource, you can try to console the inputs that you are passing in the Look up data resource in a client script. 

You can try to use Transform data resource and create a gliderecord script and from there you can return the values to UI Builder. It would be simpler if the issue persists related to the Look up resource.

Jamie L Douglas
Tera Expert

@Dibyaratnam thanks for the tips. I wasn't getting any results in the single lookup using @context.props.table & @context.props.sysId. What I ended up doing is creating a client state parameter, then in the body, created a page ready event mapping to set  client state parameter with @context.props.sysId

 

JamieD927598167_0-1737960626484.png

 

Then when I used the client state param in the single lookup I could log the result to console.

JamieD927598167_1-1737960708123.png

 

JamieD927598167_2-1737960747598.png

 

 

From there I was able to use the output of the single lookup to get the attachments I was after using 

@data.look_up_a_single_record_1.items.1.id

 

JamieD927598167_3-1737960789459.png

 

It only took me 2 days to figure this out.. Had fun learning about Workspace though!

Jamie Douglas
GlydePath Consulting
Brisbane, Australia