Transferring a local variable in an interface into a process variable

Hi all,

I have a pickerFieldUsers field in my interface that I use to store a username into a local variable "local!userToTransferTo" which looks like this:

a!pickerFieldUsers(
label: "New Owner",
labelPosition: "ABOVE",
saveInto: local!userToTransferTo,
value: local!userToTransferTo,
required: true,
validations: {},
placeholder: "--Start typing officer name--"
),

The interface that contains this field is a Process Start form for a process model.  The process model [also] has a process variable of type "User" which is called "PVUserToTransferTo".

Back in my interface, I have a buttonWidget inside a buttonArrayLayout that looks like this:

a!buttonArrayLayout(
buttons: {
a!buttonWidget(
label: "Transfer",
style: "NORMAL",
saveInto: {
a!forEach(
local!dataGridSelection,
a!save(
target: null,
value: local!dataGridSelection
)
) /*,
a!save(
pv!PVUserToTransferTo,
local!userToTransferTo
)*/
}
)
},
align: "START"
)

There's actually two problems I'm trying to solve here.  The first problem - the one that I am asking at this time - is how to get the value that gets stored in local!userToTransferTo from the pickerFieldUsers object into the process variable PVUserToTransferTo where I can subsequently use the data in the rest of my process model.  When I un-comment out the code:

a!save(
pv!PVUserToTransferTo,
local!userToTransferTo
)

The form fails to render/compile, so this code is clearly wrong in some way.

Can someone advise how I get the value that is entered into the pickerFieldUsers object into a process variable that I can use in my process model?

thanks heaps,

David

In my process model properties

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Associate Developer

    Hi David, 

    You cannot save any value into process variable as part of saveInto in an Interface. As Jose mentioned above, the values should be transferred to a variable based on the variable context.

    In your case, it is a start form and in order to save the users value in the process variable, create a rule input in the interface and save the value in that rule input. While configuring interface, map the rule input with the process variable you would like to save the values in the 'Process Start Form' as shown in the below snapshot. Please note the process variables should be selected as parameter in order to appear in the mappings in Process Start Form. 

    Hope this helps. Cheers!

  • Thanks heaps - that's got it....

    created a rule input for the form "RIUserToTransferTo" and changed my save code to:

    a!save(
    ri!RIUserToTransferTo,
    local!userToTransferTo
    )

    which seems to be accepted.  

    cheers :-)

  • Unless you're intending to use the local!userToTransferTo for something else you could simply point your a!pickerFieldUsers component directly at the rule input:

    a!pickerFieldUsers(
    label: "New Owner",
    labelPosition: "ABOVE",
    saveInto: ri!userToTransferTo,
    value: ri!userToTransferTo,
    required: true,
    validations: {},
    placeholder: "--Start typing officer name--"
    ),

Reply Children
No Data