How to reference a webapp internal name inside a webapp | Community
Skip to main content
Level 2
February 24, 2021
Solved

How to reference a webapp internal name inside a webapp

  • February 24, 2021
  • 2 replies
  • 1423 views

Hello

 

I was trying to find a way to reference the 'APP01' part of http://xxx.adobe-campaign.com/webApp/APP01 within the webapp so that I don't have to hard-code the URL in the HTML. Is this achievable?

 

Thanks,

 

Gigi

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DebTr

Hi Gigi,

One possible solution.

You can create an option and store the internal name of web app there and fetch it in webapp using the following code.

 

var intName = getOption('optionInternalName');
ctx.vars.webappInternalName = intName;

 

Thanks,

Deb

2 replies

DebTrAccepted solution
Level 6
February 25, 2021

Hi Gigi,

One possible solution.

You can create an option and store the internal name of web app there and fetch it in webapp using the following code.

 

var intName = getOption('optionInternalName');
ctx.vars.webappInternalName = intName;

 

Thanks,

Deb

gigi_jinAuthor
Level 2
February 26, 2021
Thank you Deb! That would be an option yes although ideally I wouldn't want to manually enter anything to an Option, but I guess this is as best as we could do at this stage. Thanks again!
Jonathon_wodnicki
Community Advisor
Community Advisor
February 27, 2021

Hi,

 

If it's client-side js can just get it from (window.location + '').replace(/.*\//, '').

Server-side doesn't have any info about the webapp afaik.

 

Thanks,

-Jon