Home > Forum > Actions > Subworkflow to Create new entries in a dictionary

Subworkflow to Create new entries in a dictionary
0

Hello all!

I have a process where the user will be entering Addresses and I'm saving the new entries in a Dictionary.
I have the subworkflow set up and it's working but I need to add some rules in order to not create duplicates neither empty rows.

For my case, the information to be checked will be Customer Name and Address (because a customer name can have more than one address).
I was trying to follow the query below but I'm not sure on how to add the dictionary there (in the database documentation I have, I don't find alias for a dictionary=)

if exists (
select 1 from WFElementDetails
where DET_WFDID={WFD_ID} and DET_WFCONID={WFCON:1726}
and isnull({DCNCOL:121}, '') = ''
)
select 1 else
select 0


Does anyone set up something like this?

Thank you!

MVP

Hello,
The information entered in the dictionary is saved in the database in the table WfElements.
You can see all the entries in the dictionary by the next query

select * from WfElements where wfd_dtypeid= (id)form_type

Validation for dublicate information:

if exists (
select top 1 1 from WfElementDetails
where DET_WFDID={WFD_ID} and DET_WFCONID={WFCON:1726}
and det_numeClient not in(select nume_client from WfElemets where wfd_dtypeid=form_TypeDictionary) and
and adresa_client not in (select adresa_client from WfElemets where wfd_dtypeid=form_TypeDictionary)
)
select 1 else
select 0
i

MVP

Hi Andreia,

I'm not sure what you are trying to achieve. You speak about a dictionary and use the WFElementDetails table, which stores item list information, for a duplicate check. if you are referring about workflows of type dictionaries you have to look at the WFElements table.
If you are refering to Dic* tables in the database, you going down the wrong road. They are only for internal usage.

Nevertheless, I would advise against duplicate check, you won't get far with this. If the users enters a new address, show him the existing addresses for the customer and let them decide if they want to store it.
Here's a little example:
König Straße 21a, 59231 Köln, Germany
König Straße 21a 59231 Köln, Germany
König Strasse 21 a, 59231 Köln
König Str. 21a, 59231 Köln, Germany
König Str. 21 a, 59231 Köln, NRW, Germany
König Str. 21 a, 59231 Koeln
Koenig Strasse 21 a, 59231 Koeln

These are all valid variations for the same address. The deviation range from additional white spaces to character replacement. My only idea to determine that theses are the same address is to query an external system with the provided address and use the returned harmonized address. Of course this has problems in itself.

So let the user decide if the address doesn't exist yet.

Best regards,
Daniel

In reply to: Daniel Krüger (Cosmo Consult)

Hi Andreia,

I'm not sure what you are trying to achieve. You speak about a dictionary and use the WFElementDetails table, which stores item list information, for a duplicate check. if you are referring about workflows of type dictionaries you have to look at the WFElements table.
If you are refering to Dic* tables in the database, you going down the wrong road. They are only for internal usage.

Nevertheless, I would advise against duplicate check, you won't get far with this. If the users enters a new address, show him the existing addresses for the customer and let them decide if they want to store it.
Here's a little example:
König Straße 21a, 59231 Köln, Germany
König Straße 21a 59231 Köln, Germany
König Strasse 21 a, 59231 Köln
König Str. 21a, 59231 Köln, Germany
König Str. 21 a, 59231 Köln, NRW, Germany
König Str. 21 a, 59231 Koeln
Koenig Strasse 21 a, 59231 Koeln

These are all valid variations for the same address. The deviation range from additional white spaces to character replacement. My only idea to determine that theses are the same address is to query an external system with the provided address and use the returned harmonized address. Of course this has problems in itself.

So let the user decide if the address doesn't exist yet.

Best regards,
Daniel

Hi Daniel,

The query was just an example because in the documentation I don't find the aliases when you are using a Dictionary neither I'm sure if WFElements for dictionary is the correct table to get data from.

The user will be searching the dictionary for an existing address but I would like to save if it there if it's a new entry (so the process for new additions would be automatic instead of manual input in the dictionary side).