Home > Forum > General > [Solved] How to "update" / populate item list with attachment attribute?

[Solved] How to "update" / populate item list with attachment attribute?
0

I created process where I have got:

1. Parent process with Item list:
a) description
b) attachment
2. I start child process
a) copy data + copy attachments
b) i would like to populate the same in child item list with records correlated with coped attachments ...

I did SQL source:

[code="SQL"]
SELECT
e.DET_ID as 'ID wiersza dziecka',
e.DET_WFDID as 'ID Elementu Detalu dziecka',
e.DET_WFCONID as 'ID Listy dziecka',
e.DET_Att1 as 'Rodzaj dokumentu dziecka',
e.DET_Att2 as 'ID Załącznika dziecka 1',
a.ATT_ID as 'ID Załącznika dziecka 2',
a.ATT_WFDID as 'ID Elementu Załącznika dziecka',
a.ATT_Name as 'Nazwa załącznika dziecka',
a.ATT_Description as 'Opis załącznika dziecka',
a.ATT_IsDeleted as 'Czy załącznik dziecka skasowany',
a.ATT_Attribute1 as 'Kategoria załącznika dziecka',
a.ATT_FileType as 'Rozszerzenie dziecka',
p.DET_ID as 'ID wiersza rodzica',
p.DET_WFDID as 'ID Elementu Detalu rodzica',
p.DET_Att1 as 'Rodzaj dokumentu rodzica',
p.DET_Att2 as 'ID Załącznika rodzica 1',
pa.ATT_ID as 'ID Załącznika rodzica 2',
pa.ATT_WFDID as 'ID Elementu Załącznika rodzica',
pa.ATT_Name as 'Nazwa załącznika rodzica',
pa.ATT_Description as 'Opis załącznika rodzica',
pa.ATT_IsDeleted as 'Czy załącznik rodzica skasowany',
pa.ATT_Attribute1 as 'Kategoria załącznika rodzica',
pa.ATT_FileType as 'Rozszerzenie rodzica'
FROM
WFElementDetails e
JOIN
WFDataAttachmets a ON CAST(a.ATT_ID AS VARCHAR(1000)) = e.DET_Att2
JOIN
WFElementDetails p ON p.DET_WFDID = e.DET_WFDID AND p.DET_WFCONID = e.DET_WFCONID -- Adjust this join based on your specific parent-child relationship
JOIN
WFDataAttachmets pa ON CAST(pa.ATT_ID AS VARCHAR(1000)) = p.DET_Att2
WHERE
e.DET_WFDID = '{WFD_WFDID}'


[/code]

with out "e.DET_WFDID ={WFD_WFDID}" webcon design studio ... is close to crash ...
any way ...

if i do: "e.DET_WFDID = 'parent id' i have what i wont (just for check).
on path if I put that automation - it semi work ...
is filled columns but whatever is set as "attachment" always returns "attachment was removed"

another issue is doubling records ... (probably to many joins ... )

Hi Pawel,
I don't think I fully understood what you want to achieve, but for starters:
1. if you want to display attachments from another workflow, check what type of column you have selected (screen)
2. you should add the condition DET_WFCONID = {id of your item list} to the query

In reply to: Jack

Hi Pawel,
I don't think I fully understood what you want to achieve, but for starters:
1. if you want to display attachments from another workflow, check what type of column you have selected (screen)
2. you should add the condition DET_WFCONID = {id of your item list} to the query

Hi,

I copy from parent to child attachments by start sub processes ..

on path action I would like to populate Item list
(the same ID as parent - parent <> child use the same item list)

then I would like to populate item list with data from attachments (connect them) finally I would like to remove Attachment section from view.

I have local attachment as property in Item List

MVP
In reply to: Paweł Tołoczko

Hi,

I copy from parent to child attachments by start sub processes ..

on path action I would like to populate Item list
(the same ID as parent - parent <> child use the same item list)

then I would like to populate item list with data from attachments (connect them) finally I would like to remove Attachment section from view.

I have local attachment as property in Item List

Hi Paweł,

you can update a local or related attachment column by setting the ID of the attachment.
Local are attachments which are limited to the attachments of the current workflow, while you can choose the source of the related attachment in the configuration of the column.

I have to admit, I don't understand the query itself. It seems to be completely wrong then again there's a different query in the screenshots.
As far as I understand it from the screenshot query you are adding the attachment ids of the parent workflow to the item list. If the column is a local attachments this won't work.

Best regards,
Daniel