- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 03:29 PM - edited 06-26-2025 03:55 PM
Hello,
I'm trying to make a modification to our landing page in Service Operations Workspace. Basically, we've added a user field for "nickname" and we want to use that instead of the firstName that it defaults to. I setup a local Data Resource that queries the sys_user table to get this information, but when I try to update the initialization script, it crashes when trying to read this value. If I go to the pill selector it is: data.look_up_nickname.result.nickname.value, so I've tried adding code for api.data.look_up_nickname.result.nickname.value, but it just crashes. I know the rest of the coding works, because if I hard code a name "like x = 'Smith'" then it does exactly what is expected, but only fails when trying to read from the local data resource. I've also replaced the dynamic text component with the local resource directly in the interface, so I can see that the data does exist, it's only when trying to read from the local data resource IN client script that I am having issues. Any suggestions?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 11:40 PM
Hi Simoes,
It seems so.
1. Create a client state "nickName".
2. Update client state with returned value when the data fetch succeeded
3. Use the client state in your landing page, this way it works async.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 05:41 AM
Hi,
You can concatenate "Hello" and output of new data resource
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 06:27 AM
But why does this code not work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 07:40 AM - edited 06-27-2025 07:44 AM
Hi Simoes,
Usually, the results are returned in Array of objects, maybe try api.data.look_up_nickname.result[0].u_user_nickname.value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 08:29 AM
Hi Manoj,
Thanks for the suggestion. Looking at other examples, I tried that, but still failing. Looks like it is throw an error in the browser console that result is undefined. (whether using the array index or not)