Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Anyone had luck using getMirrorURL() from sql expressions?

priyal_b
Level 3
Level 3

Hi,

Does anyone have an idea how the getMirrorURL() expression can be used? located under category "Other".

It requires a value as parameter to be passed with it, trying to figure out what that would be? which could result into giving individual mirror urls for n number of records in workflow.

 

Thanks in advance!

 

1 Accepted Solution
DavidKangni
Correct answer by
Community Advisor
Community Advisor

Hi Priyal,

code below works only if you're on hybrid mode. If you're hosted by Adobe use url-encoding cryptString('-1|<broadlog id in base16>|<delivery id in base16>')

 

If you want to use JS activity inside a workflow, see the example:

 

var url = nms.delivery.GetMirrorURL(000000001,"00000002")

 

000000001 is the delivery id

00000002 is the broadlogId (not the messageID) - passed as string in quotes

 

If you need to use it within variables:


instance.vars.deliveryId = 000000001

instance.vars.broadlogId = 00000002

instance.vars.broadlogId = instance.vars.broadlogId.toString()

 

var url = nms.delivery.GetMirrorURL(instance.vars.deliveryId,instance.vars.broadlogId)

 

To get the mirror page per user, you need to add a loop in your queryDef

Thanks,

David

View solution in original post

0 Replies
DavidKangni
Community Advisor
Community Advisor

Hi 

 

you can use it inside an enrichment for example:

 

GetMirrorURL(000000001,"00000002")

 

000000001 is the delivery id

00000002 is the broadlogId (not the messageID) - passed as string in quotes

Thanks,

David

priyal_b
Level 3
Level 3

Thanks but not sure if this works with Postgres -

I get error using this - when I try to pass hardcoded values or directly deliveryid,tostring(bradlogid)

Error-

GS-220000 PostgreSQL error: ERROR: function getmirrorurl(integer, unknown) does not exist LINE 1: ...8832_23_1 (sExpr1591908139,iId) SELECT DISTINCT GetMirrorU... ^ HINT: No function match

isahore
Level 3
Level 3

Hi @priyal_b,

The method GetMirrorURL() here in the "Others" functions takes a string value as parameter, which is the internal name of the external account configured for your instance. It returns the URL of the mirror page server that you set while setting up the external routing account. If no value is provided here, then the default value set for the instance (in the Deployment Wizard, also available as "NmsServer_MirrorPageUrl" option value) is returned.

 

isahore_0-1591906598272.png

I hope that answers the question.

 

Regards,

Ishan

 

priyal_b
Level 3
Level 3
Thanks, I tried as David suggseted but no luck, I was able to get mirror url for delivery by using nms.delivery.getmirrorrl method from JS results to a variable, However it is resulting in same url for all broadlog records, where each record should have its own different URL.. Thoughts?
Milan_Vucetic
Community Advisor
Community Advisor

Hi @priyal_b,

based on you response, you did not do iteration and have last generated Mirror link same for all customers.

You must to iteration and assign each Mirror URL to appropriate customer.

 

Regards,

Milan

DavidKangni
Correct answer by
Community Advisor
Community Advisor

Hi Priyal,

code below works only if you're on hybrid mode. If you're hosted by Adobe use url-encoding cryptString('-1|<broadlog id in base16>|<delivery id in base16>')

 

If you want to use JS activity inside a workflow, see the example:

 

var url = nms.delivery.GetMirrorURL(000000001,"00000002")

 

000000001 is the delivery id

00000002 is the broadlogId (not the messageID) - passed as string in quotes

 

If you need to use it within variables:


instance.vars.deliveryId = 000000001

instance.vars.broadlogId = 00000002

instance.vars.broadlogId = instance.vars.broadlogId.toString()

 

var url = nms.delivery.GetMirrorURL(instance.vars.deliveryId,instance.vars.broadlogId)

 

To get the mirror page per user, you need to add a loop in your queryDef

Thanks,

David

View solution in original post