Home > Forum > Data sources > updating field from another report(dictionary)

updating field from another report(dictionary)
0

hey, so i got a question about updating related fields in two separate reports. We have report with names of the people and other report which has all of those people in a field person. Now, if i change first name or last name in the first report, to also update itself in the latter report.

MVP

Hi Arthuzad,
This one is let's say tricky, and is directly connected with how WEBCON stores data in database.

Choose fields, are stored in database in WFElements as id#name in one cell, so the name being displayed is read from the value that have been saved on a specific element.
Changing the "name" in dictionary doesn't trigger any automatic updates in places, where the name have been already used (most of the time i'd say it's good behavior, as it doesn't impact history).

If you'd like to display 'current' data, then you could use calculated columns on a report, which will JOIN on the id of dictionary with id stored in specific Choose field, and return specific column.
* https://community.webcon.com/posts/post/using-calculated-columns/196/35

If you'd like to achieve the same but on the form instead of report, then - use data row, or data table fields:
* https://docs.webcon.com/docs/2025R2/Studio/Process/Attribute/DataPres/SelectField
* https://docs.webcon.com/docs/2025R2/Studio/Process/Attribute/DataPres/Sql_grid/

MVP
In reply to: Arthuzad

in this case i would need both, if the fields is updated, i want to see updated value on the report and also in the form. i get it for the calculated column in the report, but i'm not sure what you mean when it needs to impact the field in the form.

Hi Arthuzad,

Maks listed the data table/data row documentation which would to create a "calculated column" in the form.

If you really need to update the data, than you could also use the "Update related workflow" action. You can execute a "save" action on another workflow instance with this.
https://docs.webcon.com/docs/2025R1/Studio/Action/Workflow/UpdateParentWorkflow/

We have a similar case, where we need to update data in multiple processes, if the source is updated. This is handled using this action.

Best regards,
Daniel

MVP
In reply to: Arthuzad

in this case i would need both, if the fields is updated, i want to see updated value on the report and also in the form. i get it for the calculated column in the report, but i'm not sure what you mean when it needs to impact the field in the form.

Let's say we have following example:
Dictionary: People, Fields: Name, ID
Workflow: Salary Management

On some day HR created a new instance of Salary Management for new employee - John Doe, with ID 17
Few months passes, and John Doe changes last name to Doe-Foo due to getting married.

HR updates ID 17 John Doe in People Dictionary to John Doe-Foo.

Due to the fact how webcon stores the data this change will not affect Salary Management form filled in when John was employed, and on that form there will be still displayed as John Doe, same with reports.

If you have to change the display of picker value - it's not possible without changing the value of the field with new updated value:: John Doe-Foo (manually or with an action).

You could though use calculated columns on reports, or data row field on the form, which will display the data accordingly to what is currently stored under People Dictionary.


Adding to solution by Daniel - if it's necessary that's the way, but if there will be many documents in different processes/applications it might be tedious to catch them all :)

In reply to: Maksymilian Stachowiak

Let's say we have following example:
Dictionary: People, Fields: Name, ID
Workflow: Salary Management

On some day HR created a new instance of Salary Management for new employee - John Doe, with ID 17
Few months passes, and John Doe changes last name to Doe-Foo due to getting married.

HR updates ID 17 John Doe in People Dictionary to John Doe-Foo.

Due to the fact how webcon stores the data this change will not affect Salary Management form filled in when John was employed, and on that form there will be still displayed as John Doe, same with reports.

If you have to change the display of picker value - it's not possible without changing the value of the field with new updated value:: John Doe-Foo (manually or with an action).

You could though use calculated columns on reports, or data row field on the form, which will display the data accordingly to what is currently stored under People Dictionary.


Adding to solution by Daniel - if it's necessary that's the way, but if there will be many documents in different processes/applications it might be tedious to catch them all :)

starting to get it after thoroughly reading the docs. i can use only variables from the report i'm creating the calculated column in, but i need field age or name from the other report that should be based on my previous experience on wfd_guid which i'm matching from the first report field. not sure how to do formula because it's giving me unrecognized errors so far.

case
when dbo.clearwfelemid(WFD_AttChoose2) = (select wfd_guid from other_dictionary) then name(updated name variable from the other dictionary)
else 'not found'
end

MVP
In reply to: Arthuzad

starting to get it after thoroughly reading the docs. i can use only variables from the report i'm creating the calculated column in, but i need field age or name from the other report that should be based on my previous experience on wfd_guid which i'm matching from the first report field. not sure how to do formula because it's giving me unrecognized errors so far.

case
when dbo.clearwfelemid(WFD_AttChoose2) = (select wfd_guid from other_dictionary) then name(updated name variable from the other dictionary)
else 'not found'
end

Here is an example SQL which I'm using in few reports:

(
SELECT
DTYPE_Name /*Change this to any column you'll need*/
FROM
WFElements JOIN
WFSteps ON WFD_STPID = STP_ID JOIN
WorkFlows ON WF_ID = STP_WFID JOIN
WFDocTypes ON DTYPE_ID = WFD_DTYPEID
WHERE
WF_GUID = 'af556142-7203-44e1-9aa2-550c2cd321cf' AND /* GUID of the workflow - I'm working with GUID as it's shared between environments, using regular ID will break between DEV/TEST/PROD, in theory not necessary, but I'm chipping it in, if database will grow, maybe SQL optimizer will use additional Indexes*/
WFD_ID = wfelems.WFD_AttChoose3_ID /* Column which stores connection to the dictionary */
)

When using a subquery - this parenthesis is necessary.

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings