OriginalPostID-83588
Discussion posts and replies are publicly visible
Hi,
I am trying to get a username or email anything so I used loggedInUser() under display value in interface and choose a rule input to save it to data type which inturn is linked to a db, but when I submit form the record view is not displaying user name, it shows empty.
On other hand when I use rule input even for display value it is taking my input text and showing up in record view.
I just want to auto pick up username and insert in my record view which will populate my Datastore(Appian DB)
mkhaiserulla said:so I used loggedInUser() under display value in interface and choose a rule input to save it to data type
I have no idea what this means in terms of the configuration you're attempting to use, and even then I'm pretty unclear on what you're even trying to do.
What is your use case? What is your starting point? What is your on-form code? Can you share a small code snippet and/or screenshots of your configuration?
In a User Interface a save to a rule input will only be triggered as the result of a User Interaction on the form. If you want the loggedInUser() saved to a column in a database table then set it in the process model after the User has submitted the form.
thanks, @Stewart I will try this and update back if it works, I am anyway using write to data base in the process model
However other values which should be manually filled are getting saved into a database table, only this auto-generated value "loggedInUser()" is showing up as empty/Null
As I said your values will be passed to the rule inputs when a user action is made in the form. You could therefore set the value of your target the rule input with fn!loggedInUser() as part of the save of the 'Submit' button. You can test this in the form itself to prove that it's working. If the value is till not makign its way tio the database then:
Try this to see if it's working.. this field on the interface is not realising that something has been written. You still have 1 more action left i.e. 'click on submit button' .. you can modify the submit button code
saveInto: { a!save(ri!record.recordedBy,loggedInUser()) },
this way ri!record.recordedBy should get a value when you click the submit button.
Hi, Jaideep Banerjee many thanks it worked, The submit button recognized and auto-updated my logged-in name.
No changes were done to the Process model.:)