Hi,
I updated multiple records at the same time, I test "Rule!" it working fine.
I also "enable activity chaining", but it did not update username properly but updated as "Appian Administrator"
do you have any suggestion?
Thanks,
Discussion posts and replies are publicly visible
What are you using to set the value of the username, and where? (I'm guessing fn!loggedInUser() and in a process model)
I'm using this
user(loggedInUser() ,"firstName") & " "&user(loggedInUser() ,"lastName")
loggedInUser() isn't for use in a process model context. You should look into using pp!initiator instead, or adding a user PV parameter to the process and passing in a value.
the pp!initiator won't work in "Rule!". I used the Script Task to populate and update multiple records before saving to the database.
kend0001 said:the pp!initiator won't work in "Rule!".
Can you clarify what you mean by "Rule!"? Can you post a screenshot of whatever you have configured in your process model?
to get all records, I used "Rule!GetmultipleRecord()" and save those to ProcessVariables.
In the Rule!GetmultipleRecord(), I updated "addedby" field with Username in every records.
ProcessVariables will then be saved into the datastore.
Ok. So as we already said, "loggedinuser()" will not work as you're expecting in the context of a process model - it's really only made to be used on interfaces.
If you want "rule!getMultipleRecord()" to observe the user who initiated the process, you'll need to add a rule input to the rule and pass pp!initiator into the rule's input where it's called in your process model.
it work perfectly.
This is what I used : rule!getMultipleRecord(initiator: user(pp!initator ,"firstName") & " "&user(lpp!initator,"lastName"))
Inside of the the rule getMultipleRecord:
username: ri!initiator