Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Initial User Selection and Xpath

_jerome_dinnat_
Level 5
Level 5
Hi,



I try to select an initial user by Xpath expression.

I have a form with a field name binding with commonname from the edcprincipalentity table, a field userid binding with id from the same table.

I have in my process variables username (Type string)and userid (Type string) and i try to map them with my fields but they are still empty.

I try to send a form fill by a user to a user specify in the form by fill the xpath expression in initial user selection with :

- /process_data/@iduser (doesn't work)

- /process_data/@username (does'nt work)

-

/process_data/InitForm/object/data/xdp/datasets/data/RECORDS/RECORD/commonname

(does'nt work)

- /process_data/InitForm/object/data/xdp/datasets/data/RECORDS/RECORD/id (doesn't work)



Thank you for helping me.



Sorry for my English.
0 Replies
Jasmin_Charbonn
Level 10
Level 10
If you have only one field called commonname, you can try /process_data/InitForm//commonname



It'll search for a field called commonname in the whole xml. If it finds it, at least you know it's there and it's just your xpath that's not correct.



Jasmin
_jerome_dinnat_
Level 5
Level 5
Hi,



In my form I have a field name binding with commonname in my xml schema built with the edcprincipalentity table.



I tried /process_data/InitForm/object/data/xdp/datasets/data/RECORDS/RECORD/commonname



in the xpath expression but i have this error :



Assignment to XPath was specified with the following expression: /process_data/InitForm/object/data/xdp/datasets/data/RECORDS/RECORD/commonname, but this expression did not evaluate to anything.
Jasmin_Charbonn
Level 10
Level 10
I got that.



Did you try my suggestion: /process_data/InitForm//commonname



Jasmin
_jerome_dinnat_
Level 5
Level 5
yes, i just did it and I got the same error :



Assignment to XPath was specified with the following expression: /process_data/InitForm//commonname , but this expression did not evaluate to anything.
Jasmin_Charbonn
Level 10
Level 10
So I'm questioning your xml file. Can you use a logger and log it to the file system and post the content of your xml?



Jasmin
_jerome_dinnat_
Level 5
Level 5
I have a new error : No active group found with GroupPrincipalId: Tony Blue



I don't know how i did but once Tony Blue received the form fills with the corrects fields ( alex pink filled the name Tony Blue and he received the form with Tony Blue and his ID filled, I want a user fills the field "name" (ex Tony Blue) and the form will be receive by this correct person.



I changed nothing but now I have this error : No active group found with GroupPrincipalId: Tony Blue



Can you explain me how to do what I want to do ?



Thank you.
_jerome_dinnat_
Level 5
Level 5
Finally, I can send the form fill from a user to another with a "query single row" with the SQL statement

"SELECT id FROM edcprincipalentity WHERE commonname = '{$ /process_data/InitForm/object/data/xdp/datasets/data/RECORDS/RECORD/commonname $}'"



I use a variable for the id.



My new problem is that the field id binding with the id from the edcprincipalentity table is still empty. I can have it with the variable but with the binding the id's field must be fill, isn't it ?



Thank you.
Jasmin_Charbonn
Level 10
Level 10
I don't understand your last post?



Jasmin
_jerome_dinnat_
Level 5
Level 5
Sorry 😛



I created a form in LiveCycle Designer. In this form, there are two fields "commonname" and "id" binding with fields of the XML Schema edcprincipalentity I created.



In my process, an user fills the field commoname with the name Tony Blue for example. An other user receives the form but the id field is still empty.



I though the field will fill automatically.



I must use a SQL statement to retrieve the id in the table and map it in the form.



I don't understand how it works really.



Can you explain me please ? It would be very nice 🙂



Thank you.
Jasmin_Charbonn
Level 10
Level 10
I'm assuming your using and the same xfaForm variable for both users (let's called them userA and userB).



When userA fills the form and type the name Tony Blue in the commonname field and hit submit, the value Tony Blue is stored in the xfaForm variable under the schema element that is map to the commonname field (could be the same name).



Now you can get the value from that node using the xPath you've used in a previous post and make a database call to get the associated ID from the database. This WON'T happen automatically unless you make a client side webservice call to get that info.



Now using a similar xPath you can set the id field in your xfaForm variable with the value returned from the database call. Then the form should show the commonname and id values for userB.



I'm not sure what you mean by this statement: "In this form, there are two fields "commonname" and "id" binding with fields of the XML Schema edcprincipalentity I created", so my explanation might not make sense.



Jasmin