why hmacStr function is showing not defined in workflow javascript activity?

Avatar

Avatar
Ignite 1
Level 2
mousumid4747795
Level 2

Likes

4 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Validate 1
Boost 3
Boost 1
View profile

Avatar
Ignite 1
Level 2
mousumid4747795
Level 2

Likes

4 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Ignite 1
Validate 1
Boost 3
Boost 1
View profile
mousumid4747795
Level 2

06-09-2016

I have written an javascript code using hmacStr function inside workflow.

but every time got error as hmacStr not defined.

Please help.

Function I written in javascript activity

var hash1 = "abcd";
var key = "M2Y2YjkxZDEtYmNlOC1mYmI0LTkxZTgtOTNiY2RiMDhmN2E2YjExNGUwYjktNGJkYy1jZTM0LWQ1MWYtZGIwYWRlZTE0NGNh";

var encodeStr = hmacStr  (hash1, key , "SHA1");

logInfo(encodeStr);

hmacStr preset in jsAPi

1018495_pastedImage_3.png

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 2
cbvmg
Level 2

Likes

5 likes

Total Posts

10 posts

Correct reply

3 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 3
View profile

Avatar
Boost 5
Level 2
cbvmg
Level 2

Likes

5 likes

Total Posts

10 posts

Correct reply

3 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 3
View profile
cbvmg
Level 2

08-09-2016

Hi @mousumid47477958,

Firstly key is optional and can be used to specify the encoding type. By default, Adobe Campaign uses UTF-8, but there is no harm is specifying it either.

Now, here is the magic... you should use HMACStr() instead of hmacStr() .

Sample Code:

var encodeStr = HMACStr("Adobe Campaign","UTF-8","md5");

logInfo(encodeStr);

Enjoy !

Regards,

Madhan

Answers (1)

Answers (1)

Avatar

Avatar
Level 1
javeedsb2018
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile

Avatar
Level 1
javeedsb2018
Level 1

Likes

0 likes

Total Posts

1 post

Correct reply

0 solutions
View profile
javeedsb2018
Level 1

16-11-2018

Hi Madhan,

cbvmg Thank you