I need to have my title as the keyname the problem is this could cause problems with duplicate keynames, how can i check if it exists and add -1 to the end if it does, or add -2 to the end if -1 exists.
keyName = "hello"
duplicates = Entry.get_by_key_name(keyName)
if duplicates:
keyName = keyName+("-1")
How do i loop through adding 1 until I find a unique name?
any help is much appreciated
J
1 Answer