This is a demo to show how the dropdown could be filtered using the "usedcount" also counting how many time the name was used
There is also a mechanism used to prevent the deletion of the data if it is used in the other form
Meaning that the form that uses the data from a source form sets the counter about how many times the data have been used. And there is a delete rule on source form to check the "used counter" and fail the deletion of the used count is more than 0
Records in f
profileName |
Used count |
---|---|
hello | 1 |
hel | 0 |
new | 0 |
new | 0 |
uytuty | 1 |
val | 0 |
val | 0 |
Test | 0 |
Test | 0 |
test | 0 |
GreetYou | 0 |
Timen | 0 |
pb | 0 |
0 | |
hello | 0 |
hello | 0 |
tr | 0 |
Boris | 0 |
sddfs | 0 |
hello | 0 |
Ah | 0 |
ee | 0 |
8634ae94-b446-4260-8b79-6fb13579e701 | 0 |
a | 0 |
kek | 0 |
fff | 0 |
AML | 0 |
A1 | 0 |
A1 | 0 |
yyyyyyyy | 0 |
test | 0 |
test | 0 |
ggg | 0 |
hi | 0 |
hello | 0 |
abcd | 0 |
sdf | 0 |
new | 0 |
peggy | 0 |
pam | 0 |
hadley | 0 |
HS01 | 0 |
TSN | 0 |
12345 | 0 |
jonzo ball | 0 |
hello | 0 |
test | 0 |
sdv | 0 |
val | 0 |
uyt | 0 |
hello | 0 |
wert | 0 |
0 | |
Xav | 0 |
val | 0 |
Maus123 | 0 |
Maus123 | 0 |
lauraaaaa | 0 |
RAProfile | 0 |
PINOY | 0 |
PINOY | 0 |
fgfgsd | 0 |
sign | 0 |
Rohit | 0 |
pb | 0 |
asdfasdf | 0 |
asdfasdf | 0 |
vbnbvn | 0 |
new | 0 |
hello | 0 |
test | 0 |
hello | 0 |
hello | 0 |
hello | 0 |
James Bond | 0 |
asd | 0 |
pro1 | 0 |
pro2 | 0 |
confluence | 0 |
rfcrf | 0 |
1 | 0 |
123 | 0 |
hello | 0 |
hello | 0 |
pb | 0 |
kk | 0 |
super | 0 |
JANJANJAN | 0 |
Nakki | 0 |
mohan | 0 |
test | 0 |
36328 | 0 |
af | 0 |
hello | 0 |
test | 0 |
test | 0 |
a | 0 |
AMBESTEN | 0 |
AMBESTEN | 0 |
hello | 0 |
56kl | 0 |
t | 0 |
sddqdqd | 0 |
Test1 | 0 |
new | 0 |
hello | 0 |
hello | 0 |
möge die macht mit dir sein | 0 |
222 | 0 |
test | 0 |
new | 0 |
hellow | 0 |
nnnn | 0 |
qwer | 0 |
test | 0 |
Sumant | 0 |
1 | 0 |
hello | 0 |
abcXXX | 0 |
ABCDE | 0 |
val | 0 |
test | 0 |
Test | 0 |
1 | 0 |
Eva | 0 |
QWERTY | 0 |
wtf | 0 |
Recods in f2
profileName |
---|
hello |
hello |
hello |
hello |
hello |
hel |
hel |
uytuty |
hello |
uytuty |
val |
val |
val |
val |
Test |
hello |
uytuty |
test |
Test |
Test |
GreetYou |
pb |
hello |
hello |
tr |
Boris |
hello |
Boris |
hello |
hel |
Ah |
GreetYou |
val |
uytuty |
hello |
kek |
test |
hello |
hello |
hello |
new |
A1 |
A1 |
test |
hello |
new |
uytuty |
Test |
hello |
hello |
new |
hello |
val |
GreetYou |
tr |
hello |
hadley |
val |
HS01 |
12345 |
jonzo ball |
hello |
val |
val |
val |
hello |
hello |
new |
uyt |
uyt |
uyt |
uyt |
uyt |
uyt |
uyt |
uyt |
uyt |
uyt |
uyt |
wert |
wert |
wert |
wert |
wert |
wert |
wert |
wert |
wert |
wert |
wert |
wert |
test |
hello |
test |
12345 |
kek |
hello |
Maus123 |
hello |
hello |
hel |
uytuty |
PINOY |
hello |
hello |
hello |
val |
hello |
Boris |
test |
test |
test |
new |
pro1 |
pro2 |
rfcrf |
new |
hello |
Boris |
Rohit |
super |
Ah |
JANJANJAN |
hello |
new |
JANJANJAN |
asdfasdf |
Test |
pb |
Test |
8634ae94-b446-4260-8b79-6fb13579e701 |
8634ae94-b446-4260-8b79-6fb13579e701 |
Boris |
Nakki |
Nakki |
test |
val |
test |
Test |
36328 |
asdfasdf |
test |
test |
uytuty |
hello |
new |
hello |
t |
sddfs |
hel |
hello |
hello |
möge die macht mit dir sein |
hello |
hello |
val |
222 |
hello |
nnnn |
qwer |
test |
Test1 |
test |
test |
test |
hello |
sdv |
hel |
222 |
hello |
val |
Test |
test |
Test |
Test |
val |
1 |
1 |
val |
Source code for the solution
<ac:structured-macro ac:macro-id="323f6007-384e-41ce-8d66-7d65c436f281" ac:name="confiform" ac:schema-version="1"> <ac:parameter ac:name="formName">f01</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="ef798ae4-d4a7-42c4-8c3e-4b93c2f56286" ac:name="confiform-entry-register" ac:schema-version="1"> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> <p> <ac:structured-macro ac:macro-id="b9706e4b-d98e-4cdf-8452-07c715edc161" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="fieldName">profileName</ac:parameter> <ac:parameter ac:name="fieldLabel">profileName</ac:parameter> <ac:parameter ac:name="type">text</ac:parameter> </ac:structured-macro> </p> <p> </p> <p> <ac:structured-macro ac:macro-id="4d2758d3-4c25-4466-84be-3340a02e5f5d" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="fieldName">used</ac:parameter> <ac:parameter ac:name="fieldLabel">Used</ac:parameter> <ac:parameter ac:name="values">false</ac:parameter> <ac:parameter ac:name="type">hidden</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="6690c163-f11d-4f0c-b892-2c7b3f14459e" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="fieldName">usedcount</ac:parameter> <ac:parameter ac:name="fieldLabel">Used count</ac:parameter> <ac:parameter ac:name="values">0</ac:parameter> <ac:parameter ac:name="type">hidden</ac:parameter> </ac:structured-macro> </p> <ac:structured-macro ac:macro-id="11c04fe8-aa43-49d0-a460-a0b1cec79e01" ac:name="confiform-ifttt" ac:schema-version="1"> <ac:parameter ac:name="condition">used:true</ac:parameter> <ac:parameter ac:name="extras3">true</ac:parameter> <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter> <ac:parameter ac:name="event">onModified</ac:parameter> <ac:parameter ac:name="title">entryId=[entry.id]&usedcount=([entry.usedcount]+1)&used=true</ac:parameter> <ac:parameter ac:name="who">f01:12222622</ac:parameter> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="fef83b62-6842-4374-8d32-3b13abeb38ed" ac:name="confiform-ifttt" ac:schema-version="1"> <ac:parameter ac:name="condition">used:false</ac:parameter> <ac:parameter ac:name="extras3">true</ac:parameter> <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter> <ac:parameter ac:name="event">onModified</ac:parameter> <ac:parameter ac:name="title">entryId=[entry.id]&usedcount=([entry.usedcount]-1)&used=false</ac:parameter> <ac:parameter ac:name="who">f01:12222622</ac:parameter> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> <p> <ac:structured-macro ac:macro-id="965ed455-9a0a-461f-93ab-49fad96f376b" ac:name="confiform-field-definition-rules" ac:schema-version="1"> <ac:parameter ac:name="condition">usedcount:>0</ac:parameter> <ac:parameter ac:name="fieldName">You cannot edit this record (it is used (referenced) in other form)</ac:parameter> <ac:parameter ac:name="action">Validate on delete</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="3aebe087-a1d1-4b14-9367-7c87a4efd011" ac:name="confiform" ac:schema-version="1"> <ac:parameter ac:name="formName">f11</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="28803937-25f6-4738-92e5-ea53d8edae7f" ac:name="confiform-entry-register" ac:schema-version="1"> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> <p> <ac:structured-macro ac:macro-id="578f2f88-9e05-4491-9a34-40c139c23152" ac:name="confiform-field-definition" ac:schema-version="1"> <ac:parameter ac:name="fieldName">profileName</ac:parameter> <ac:parameter ac:name="fieldLabel">profileName</ac:parameter> <ac:parameter ac:name="values">[12222622|f|profileName|true||]</ac:parameter> <ac:parameter ac:name="type">smartselect</ac:parameter> </ac:structured-macro> </p> <ac:structured-macro ac:macro-id="ea265827-080b-4f1f-b859-7728658da04f" ac:name="confiform-ifttt" ac:schema-version="1"> <ac:parameter ac:name="extras5">true</ac:parameter> <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter> <ac:parameter ac:name="event">onCreated</ac:parameter> <ac:parameter ac:name="title">entryId=[entry.profileName]&used=true</ac:parameter> <ac:parameter ac:name="who">f:12222622</ac:parameter> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="a9b4c52e-dc2c-412c-a353-0609b30ae72f" ac:name="confiform-ifttt" ac:schema-version="1"> <ac:parameter ac:name="extras5">true</ac:parameter> <ac:parameter ac:name="condition">hasChanged(profileName):true</ac:parameter> <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter> <ac:parameter ac:name="event">onModified</ac:parameter> <ac:parameter ac:name="title">entryId=[entry._previousState.profileName]&used=false</ac:parameter> <ac:parameter ac:name="who">f01:12222622</ac:parameter> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="ecd1c878-ddfb-4ce4-9f06-796a3334935b" ac:name="confiform-ifttt" ac:schema-version="1"> <ac:parameter ac:name="extras5">true</ac:parameter> <ac:parameter ac:name="condition">hasChanged(profileName):true</ac:parameter> <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter> <ac:parameter ac:name="event">onModified</ac:parameter> <ac:parameter ac:name="title">entryId=[entry.profileName]&used=true</ac:parameter> <ac:parameter ac:name="who">f01:12222622</ac:parameter> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="01a76f72-1c9f-44d5-be3b-38038a419dc0" ac:name="confiform-ifttt" ac:schema-version="1"> <ac:parameter ac:name="extras5">true</ac:parameter> <ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter> <ac:parameter ac:name="event">onDeleted</ac:parameter> <ac:parameter ac:name="title">entryId=[entry.profileName]&used=false</ac:parameter> <ac:parameter ac:name="who">f01:12222622</ac:parameter> <ac:rich-text-body> <p> </p> </ac:rich-text-body> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro> <p>Records in f</p> <ac:structured-macro ac:macro-id="a08b6b66-1070-48a8-b56b-1416630b937a" ac:name="confiform-table" ac:schema-version="1"> <ac:parameter ac:name="formName">f01</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="542e9d47-c466-4ae8-948d-45b961c32214" ac:name="confiform-field" ac:schema-version="1"> <ac:parameter ac:name="fieldName">profileName</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="fd0b30d1-4185-4a29-b5e3-83d6cb47aeaf" ac:name="confiform-field" ac:schema-version="1"> <ac:parameter ac:name="fieldName">usedcount</ac:parameter> </ac:structured-macro> </p> </ac:rich-text-body> </ac:structured-macro> <p> </p> <p>Recods in f2</p> <p> </p> <ac:structured-macro ac:macro-id="b9cb1824-20f7-49f2-afd2-dfa95775899b" ac:name="confiform-table" ac:schema-version="1"> <ac:parameter ac:name="formName">f11</ac:parameter> <ac:rich-text-body> <p> <ac:structured-macro ac:macro-id="b5bc0a57-2d00-4e21-973b-b98a3f369ca0" ac:name="confiform-field" ac:schema-version="1"> <ac:parameter ac:name="fieldName">profileName</ac:parameter> </ac:structured-macro> </p> <p> </p> </ac:rich-text-body> </ac:structured-macro>