How to reference a webapp internal name inside a webapp

Avatar

Avatar
Validate 1
Level 1
gigi_jin
Level 1

Likes

0 likes

Total Posts

24 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Applaud 5
Affirm 1
View profile

Avatar
Validate 1
Level 1
gigi_jin
Level 1

Likes

0 likes

Total Posts

24 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Applaud 5
Affirm 1
View profile
gigi_jin
Level 1

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
Affirm 25
Level 4
Deb007
Level 4

Likes

50 likes

Total Posts

86 posts

Correct reply

25 solutions
Top badges earned
Affirm 25
Boost 25
Applaud 5
Give Back 5
Validate 1
View profile

Avatar
Affirm 25
Level 4
Deb007
Level 4

Likes

50 likes

Total Posts

86 posts

Correct reply

25 solutions
Top badges earned
Affirm 25
Boost 25
Applaud 5
Give Back 5
Validate 1
View profile
Deb007
Level 4

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
Establish
MVP
wodnicki
MVP

Likes

982 likes

Total Posts

1,097 posts

Correct reply

517 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

982 likes

Total Posts

1,097 posts

Correct reply

517 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
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