lswank
Canvas Initiate

Assigning a variable in Javascript to equal a calculated value on form

Hello,

I am trying to reference a calculated value on my form (Client ID JS variable name = calcID) and set that value equal to varID in the javascript code in order to concat a URL based on the ID. Could someone help? When I hard code in an ID, it works, but I need it to be dynamic. 

 

lswank_1-1609878669578.png

Thanks!

Tags (1)
0 Kudos
Reply
1 Reply
MegaJerk
Automation Master
Automation Master

Re: Assigning a variable in Javascript to equal a calculated value on form

Your url property for the ajax object looks incorrectly set to the value of:

{url: _siteUrl + "/_api/web/lists/getbytitle('" + listname + "')/items(id)"}

 

which does NOT concat the id variable to the string as it's within the ending Double Quote.

 

It should likely be: 

{url: _siteUrl + "/_api/web/lists/getbytitle('" + listname + "')/items(" + id +")"}

 

Does this help?

0 Kudos
Reply