0

I found a github repo with custom activity:

https://github.com/smashew/sfmc-example-jb-custom-activity

Here it is mentioned:

"For each request, we include two Guid fields activityId and definitionInstanceId in the request body. Parse the values from the payload and use the combination of these two values as a way to dedupe a request."

Does anyone know how this should be added in the code? Our goal is to stop execute of the code and not to hit external api once the duplicate is found(due to retryCount higher than 1).

Thanks, Monika

1 Answer 1

0

Welcome to Salesforce Stack Exchange (SFSE)!

Have you run the app locally as the repo README suggests in the "Getting Started" section?

The very first paragraph of the GitHub repo you link to states [emphasis added by me]:

This repository contains a number of custom activity examples for Salesforce Journey Builder. These examples are intended to help you understand how Journey Builder works and get a head start on building your own custom activities.

It seems to me that you should "poke around" in the modules folder of the repository after you have run the app locally and seen the examples to get an idea of how to add your own code.

UPDATE

In response to your first comment on this answer, I went back to that repo and started digging a bit deeper myself.

For some reason if you search this repo for activityId or definitionInstanceId the search returns empty. But if you drill into the discount-code module you can find those variables in index.js, as well as in sampleInteraction.js in the discount-redemption-split module.

However, while digging around I also noticed this in the corner: enter image description here

If you go to the original repo (https://github.com/salesforce-marketingcloud/sfmc-example-jb-custom-activity) you will find activityId and definitionInstanceId in more JS files.

It seems to me that the owner of the repo you found forked the original, kept the original README, and has made modifications that might or might not work. So you might want to consider going to the original repo to see if it does what you want it to.

3
  • Hi @Moonpie, thank you :) Yes, I went through the repo, however I haven't noticed any validation of ActivityId+definitionInstanceId in the code, hence my question here. Commented Nov 24, 2022 at 10:31
  • Did you see my update, and did that help?
    – Moonpie
    Commented Nov 27, 2022 at 15:49
  • Hi @Moonpie, I've looked through the original repo, however I didn't find any reference of validation of the combination of activityId and definitionInstanceId as suggested in the readme file. This is still a bit mistery for me. Commented Nov 29, 2022 at 9:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .