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?