cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Attribute in Register User form not working

AshishDas
Regular Contributor
Regular Contributor

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

9 REPLIES 9

rushikeshvartak
All-Star
All-Star

select username as ID from users where users.companyname='${Companyname}'

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

AshishDas_0-1669052073372.png

{"log":"2022-11-21 17:28:40,117 [http-nio-8080-exec-80] 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-21T17:28:40.117165663Z"}
2022-11-21, 10:58 pm
ecm
{"log":"2022-11-21 17:28:40,117 [http-nio-8080-exec-80] DEBUG workflow.JbpmworkflowmanagementController - jsonProduct--[results:[], total:0]\n","stream":"stdout","time":"2022-11-21T17:28:40.117636066Z"}
2022-11-21, 10:58 pm
ecm
{"log":"2022-11-21 17:28:37,260 [http-nio-8080-exec-94] DEBUG workflow.JbpmworkflowmanagementController - getSelect2DataforDAJson---[query:, pagenum:1, sqlQryStr:, attrId:21, rolekey:, userkey:, _:1669051716011, controller:jbpmworkflowmanagement, action:getSelect2DataforDAJson]\n","stream":"stdout","time":"2022-11-21T17:28:37.260256071Z"}
2022-11-21, 10:58 pm
ecm
{"log":"2022-11-21 17:28:37,260 [http-nio-8080-exec-94] DEBUG workflow.JbpmworkflowmanagementController - finalQuery--select ID as ID from (select companyname as ID from users where userkey='8') as T order by ID\n","stream":"stdout","time":"2022-11-21T17:28:37.260727254Z"}

Share company name dynamic attribute screenshot

Please find below:

Parent attribute of manager is Companyname and Action to perform on parent change is : MAPPING

AshishDas_0-1669052746134.pngAshishDas_1-1669052765949.pngAshishDas_2-1669052795341.png

Add mapping keyword which is missing

What action to perform when Parent attribute changes? MAPPING

Hi Rushikesh,

This change also is generating no values in dropdown. The parent attribute is the Companyname. I have included MAPPING keyword though.

AshishDas_0-1669106379010.png

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

Try mapping a mapping /Mapping

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"

Try changing order of dynamic attribute .

you can change by changing label like 1. A & 2. b