cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Customer Data Cloud Screen-sets handling custom logic in Javascript

Rvanjari
Participant
0 Likes
839

Hi All , I am working with screen-sets in CDC for registration, profile updates, and login, and I want to implement custom handling on these screens.

During registration, I would like to trigger a REST API call (Gigya REST API) on the Submit event in JavaScript to perform additional actions.

Is this possible? How can I call accounts.getAccountInfo, and how should I manage authentication parameters?

Many Thanks,

Ruchita

Accepted Solutions (0)

Answers (1)

Answers (1)

kobico
Product and Topic Expert
Product and Topic Expert

 

Hi Rvanjari,

You can listen to the onAfterSubmit event and call gigya.accounts.getAccountInfo({callback: fn}) to retrieve user data.

The SDK handles authentication automatically, so there is no need to pass any parameters.

For a more robust approach, consider using gigya.accounts.addEventHandlers({onLogin: fn}), which triggers on any login action, regardless of the screen where it originated.

You can find more details here:
Handling Authentication Events – SAP Customer Data Cloud

~~~~~~~~~ Update ~~~~~~~~~~

To ensure that profile.email remains unique across all users, I recommend setting up an IDX job or extension, depending on what fits best. This can then call setAccountInfo with the "addLoginEmails" parameter, making the email a login identifier.

Let me know if you need further clarification.

Best regards,

Rvanjari
Participant
0 Likes
Hi , In my case i wanted to check the email address already exist , before even creatign an account , in some cases there are accounts in CDC without loginIDs , so the default ootb provided will not work so looking for a search account with the email address user entered.
kobico
Product and Topic Expert
Product and Topic Expert
0 Likes

I don't recommend using search during end user flow as it's not intended for that. search api can be heavy and not optimized for such use case. I understand what you are trying to achieve, but if you need the email to be unique the proper way is to define it as login identifier. I'll update my answer