Home > Forum > Actions > [SOLVED] How from 1 item list take data to populate another Item list ?

[SOLVED] How from 1 item list take data to populate another Item list ?
0

I have got:

1. proces with Item list where:
a) I set person (from AD)
b) in item list in that proces I add competitions
final I have got step finish
- Person
- Item list what he/she can do.
From that I created data sorce with columns, so i have multi rows:
Person 1 = can do 1
Person 1 = can do 2
Person 2 = can do 1
Person 3 = can do 2

2. In other proces I have got attribute:
a) Item list A [pick person]
So I create List
Person 1
Person 3

b) Item list B [sorce proces 1 ]
I would like to populate Item List B with only:
Person 1 and Person 3 - who I pick in Item List A

I webcon I don't know how:
- for each row in Item List A check if column Person = Person in data sorce - copy all to Item List B and repeat
- if i Could initialize it .. could be grate .. if not .. I can add this to step / path ect. / menu button

At the moment if I have Dropdown list and One Person then I can do Filter to Itemlist B ...
If in Drop down list I have got 2 or more people then filter is not working because is more than One ...
so ...
I dropped that Idea because Item list is more readable than dropdown list ...

And now I stopped on depending Item Lists ... :/

MVP

Hi,
I haven't encountered this situation before. However, I can offer you a few ideas. I hope they help.
I think you should make use of the settings in the item list, specifically the 'Initialize'
In the main item list when adding/modifying a column, you should put in 'Style and behavior' a foreach, and if the condition is okay, to execute the form rule 'initialize itemlist'.
I found this post; maybe you can get an idea starting from this one.
https://community.webcon.com/posts/post/javascript-functions-in-the-html-form-fields-part-2/167/23
You can create a javascript form rule that it add a rows in itemlist.
I hope some of these ideas will be helpful to you.



Thanks,
Raluca

In reply to: Raluca-Mirabela Lupu

Hi,
I haven't encountered this situation before. However, I can offer you a few ideas. I hope they help.
I think you should make use of the settings in the item list, specifically the 'Initialize'
In the main item list when adding/modifying a column, you should put in 'Style and behavior' a foreach, and if the condition is okay, to execute the form rule 'initialize itemlist'.
I found this post; maybe you can get an idea starting from this one.
https://community.webcon.com/posts/post/javascript-functions-in-the-html-form-fields-part-2/167/23
You can create a javascript form rule that it add a rows in itemlist.
I hope some of these ideas will be helpful to you.



Thanks,
Raluca

Thx, I will check ...
in meanwhile I try different angle ...

BTW: I don't know JS or SQL but I try ...

I was play with SQL request (from Data source created which I use in Item list ..) and more less I have in second Item List filtered to

[code]
SELECT
WFD_ID,
WFD_Signature,
DEF_ID,
dbo.ClearWFElemAdv(ISNULL(WFD_AttChoose1, '''')) as WFD_AttChoose1,

DET_ID,
dbo.ClearWFElemAdv(ISNULL(DET_Att2, '''')) as DET_Att2,
ISNULL(DET_Att3, '''') as DET_Att3

FROM V_WFElements as wfelems
LEFT JOIN WFElementDetails on (DET_WFDID=WFD_ID and DET_WFCONID=2719)

WHERE WFD_ID IN (
SELECT WFD_ID FROM WFElements
JOIN WFDocTypes ON WFD_DTYPEID = DTYPE_ID
JOIN WFSteps ON WFD_STPID = STP_ID
where WFD_DTYPEID in (110) and WFD_STPID in (406) /*ADVANCEDINNERSEARCH*/ AND (1=1 )
)
[/code]

this gives me
table with out filtration ... (yet) now I need to compare item list 1 to results ...

In reply to: Paweł Tołoczko

2022.1.4.404

Using Chat GPT and proper questions / description I have proper working Item list.

I) Process 1 :
Configuration:
1) Drop down list = AD User = Jone Doe
2) Item list:
a) column 1 = Range >> from Dictionary process
b) Description = column 1 triers column 2 from the same dictionary

2) Process 2:
Item List 1
a) picked Range = from the same dictionary as Process 1

Item List 2
a) in initialization is SQL source (see attachment)
Used as "template" to pick proper person (grouping by "Range" and "description") - users will repeat depending of qualification.

Item List 3
a) from Process 1 pick Person

[code="SQL"]
SELECT DISTINCT
SUBSTRING(audytor.WFD_AttChoose1, CHARINDEX('#', audytor.WFD_AttChoose1) + 1, LEN(audytor.WFD_AttChoose1)) AS Osoba,
audytor_details.DET_Att3 AS Zakres,
SUBSTRING(audytor_details.DET_Att2, CHARINDEX('#', audytor_details.DET_Att2) + 1, LEN(audytor_details.DET_Att2)) AS [Nazwa - rodzaj normy],
proces2.WFD_ID AS [ID Obiegu w Procesie 2]
FROM
V_WFElements AS audytor
JOIN
WFElementDetails AS audytor_details
ON audytor.WFD_ID = audytor_details.DET_WFDID
AND audytor_details.DET_WFCONID = '{WFCON:2719}' -- ID listy pozycji w procesie "Audytor"
JOIN
V_WFElements AS proces2
ON proces2.WFD_ID IN (
SELECT
proces2_details.DET_WFDID
FROM
WFElementDetails AS proces2_details
WHERE
proces2_details.DET_WFCONID = '{WFCON:2766}' -- ID pierwszej listy pozycji w 2 procesie
AND proces2_details.DET_Att1 = audytor_details.DET_Att2
AND proces2_details.DET_WFDID = '{WFD_ID}' -- ID elementu listy pierwszej w procesie 2
)
WHERE
audytor.WFD_AttChoose1 IS NOT NULL
[/code]