11-21-2022 12:57 AM
Hi,
We have a requirement in which the companyname of the user being created should be equal to the company name of the requestor via the Create User Form. However, the manager to be shown in the dropdown should belong to the company name select, which isn't working.
Dynamic Attribute1:
AttributeName : Companyname
Attribute Type : Single Select from SQL Query
Query : select companyname as ID from users where userkey='${requestor}' [This is working]
Dynamic Attribute 2:
AttributeName : Manager
Attribute Type : Single Select from SQL Query
Query : select username as ID from users where users.companyname=${Companyname}
Parent Attribute : Companyname
What action to perform when Parent attribute changes? MAPPING
The manager field is showing null values as the query isn't fetching any company name.
Error : {"log":"2022-11-21 08:23:19,314 [http-nio-8080-exec-20] DEBUG workflow.JbpmworkflowmanagementController - finalQuery--select ID as ID from (select distinct owner as ID from users where users.companyname='') as T order by ID\n","stream":"stdout","time":"2022-11-21T08:23:19.314307078Z"}
Please help
11-21-2022 09:11 AM
select username as ID from users where users.companyname='${Companyname}'
11-21-2022 09:38 AM
Hi Rushikesh,
Thank you for the response. Tried the query above but the dropdown does not populate any value. Please see the error below: It isn't able to fetch company name as seen in the error
11-21-2022 09:39 AM
Share company name dynamic attribute screenshot
11-21-2022 09:47 AM
Please find below:
Parent attribute of manager is Companyname and Action to perform on parent change is : MAPPING
11-21-2022 09:49 AM
Add mapping keyword which is missing
What action to perform when Parent attribute changes? MAPPING
11-22-2022 12:41 AM
Hi Rushikesh,
This change also is generating no values in dropdown. The parent attribute is the Companyname. I have included MAPPING keyword though.
This query worked : select username as ID from users where companyname =(select companyname from users u1 where u1.userkey='${requestor}')
However, I wanted to know how to do it via Dynamic Attribute variable
11-22-2022 06:19 AM
Try mapping a mapping /Mapping
11-23-2022 07:42 AM
Thanks for your reply.
But this is also not working:
In logs we can see it's fetching '${Companyname}' as blank.
{"log":"2022-11-23 15:26:08,798 [http-nio-8080-exec-159] DEBUG workflow.JbpmworkflowmanagementController - finalQuery--select ID as ID from (select username as ID from users where users.companyname='''') as T order by ID\n","stream":"stdout","time":"2022-11-23T15:26:08.798703443Z"
11-23-2022 12:52 PM
Try changing order of dynamic attribute .
you can change by changing label like 1. A & 2. b