How to call the data resource from Client Scripts UI Builder
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 10:41 AM - edited 12-10-2023 10:59 AM
Hello All,
I have define the state parameter "atternityLink" its type is string and have given initial value to that link.
I have define the state parameter "atternityLink" its type is string and have given initial value to that link.
Below is the client script where I am trying to set the state value but not working. But everytime I am getting the same value which I have provided as initial value.
const userId = api.data.caller_info.result.user_name.value;
const userId = api.data.caller_info.result.user_name.value;
const ciName = api.data.device_info.results.name.value;
urlLink = "URLSTRING1" + ciName+ "URLSTRING2" + userId +"URLSTRING3"
api.setState("atternityLink",urlLink)
data.caller_info.result & api.data.device_info.results are local data resources .
Thanks
Mohammed Ghouse
Thanks
Mohammed Ghouse
9 REPLIES 9
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 12:25 PM
Hi @mohammedghouse ,
You can try as below
urlLink = "URLSTRING1" + ${ciName}+ "URLSTRING2" + ${userId} +"URLSTRING3"
api.setState("atternityLink",urlLink)
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 10:41 PM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 12:36 PM
Hi @mohammedghouse ,
my guess would be that you are using CONST. So you are not allowing the variable to change dynamically. Change your variables to either let or var.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2023 09:28 PM