3

I want to generate a unique ID in a Data Extension each time a record is created via SmartCapture using Cloud Pages.

I am trying to use the ClaimRow() function to do this by pulling the unique ID from another Data Extension but unfortunately, this doesn't seem to work when I add the AMPscript to the SmartCapture form:

%%[
VAR @UniqueID
SET @UniqueID = ClaimRow("UniqueIDs", "IsClaimed")
IF EMPTY(@UniqueIDs) THEN ]%%
No Unique IDs available
%%[ ELSE ]%% 
Your Unique ID is %%= FIELD(@UniqueID,'UniqueID') =%%
%%[ ENDIF ]%% 

Is there another way to auto-generate a unique id for a new Data Extension record? Or does someone know where exactly the AMPscript should be placed in the SmartCapture form?

0

To answer your question about generating a unique ID, it can be achieved by using the GUID() AMPscript function.

An example: %%=GUID()=%%

Result: bc9c9237-9604-410d-89e6-4653bf15e008

Reference: GUID

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.