How to reference a webapp internal name inside a webapp

Avatar

Avatar

gigi_jin

Avatar

gigi_jin

gigi_jin

24-02-2021

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

 

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Deb007

Avatar

Deb007

Deb007

25-02-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

Answers (1)

Answers (1)

Avatar

Avatar

wodnicki

MVP

Avatar

wodnicki

MVP

wodnicki
MVP

26-02-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