Populate Grid from Process Model

Hello, 

I would like to show an Array of values inside a grid.
These values are stored as Array of CDT inside a Process Model into a variable called Result.

I have created a const Rule of type Process Model with my process model:

Inside my Interface I have:

=load(
local!data: cons!DLF_constGetAllPrototype,
local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: -1, sort: a!sortInfo(field: "name", ascending: true)),
with(
local!datasubset: todatasubset(local!data.result, local!pagingInfo),
a!gridLayout(
label: "Metadati",
totalCount: count(local!data.result),
headerCells: {
a!gridLayoutHeaderCell(label: "Id" )
},
columnConfigs: {
a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 )
},
rows: a!forEach(
items: local!data.result,
expression: a!gridRowLayout(
id: fv!index,
contents: {
a!paragraphField(
label: "valore " & fv!item.description,
value: fv!item.description
)
}
)
)
)
)
)

Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function 'todatasubset' parameter 2 [line 5]: Invalid index: Cannot index property 'result' of type Text into type Process Model

I'm very new to Appian and I think I have several errors, but I can't figure out.

Tks

  Discussion posts and replies are publicly visible

Parents
  • Hi Rinaldo

    Ok, I can see the line of thinking you're taking and, yes, there are several mistakes here.

    So: the data you want displayed din the form is being stored into an array that is a process variable in a Process Model. Assuming you know that is working, then you need to pass that data from the process model to your form. So I would expect your form to have a rule input that you can accept that data into the form and then can work with it.

    It looks like you think your constant (of type process model?) can make reference to your process variable. But it can't for the simple reason that the constant is acting as a pointer to a process MODEL and not a process INSTANCE.

    So, back to your process model. I'm second guessing that you're able to start it (as an 'Action' or a 'Related Action') and that there is (my best guess) a Script Task that is deriving the value that you're storing into the process variable 'result'.

    So immediately after this step you'll need to add a 'User Input Task' (which you can think of as a 'container' for a form you want to display); and then you'll need to add your form to this (make sure you've added the 'result' as a rule input to your form and set it to the correct data type and made it an array!)

    When you import the form to your User Input Task Appian will ask you "Do you want to automatically create node inputs to match your interface's inputs? " and you should say 'Yes' to this. This will create a variable in the context of the User Input Task that will be mapped to the rule input of your form (it;s worth noting that a rule input on an interface is NOT a variable! It acts as a reference, or a 'pointer' to a variable which, in this case, is the variable in the User Input Task that Appian has just kindly created for you!)

    Now you need to get the value from your process variable into the variable in the User Input Task, so go to the 'Inputs' tab of your User Input Task and in the 'Value' drop-down pick the process variable that holds your data.

    This should get you to where the form now displays the data you've retrieved in your process.

    Good luck!

Reply
  • Hi Rinaldo

    Ok, I can see the line of thinking you're taking and, yes, there are several mistakes here.

    So: the data you want displayed din the form is being stored into an array that is a process variable in a Process Model. Assuming you know that is working, then you need to pass that data from the process model to your form. So I would expect your form to have a rule input that you can accept that data into the form and then can work with it.

    It looks like you think your constant (of type process model?) can make reference to your process variable. But it can't for the simple reason that the constant is acting as a pointer to a process MODEL and not a process INSTANCE.

    So, back to your process model. I'm second guessing that you're able to start it (as an 'Action' or a 'Related Action') and that there is (my best guess) a Script Task that is deriving the value that you're storing into the process variable 'result'.

    So immediately after this step you'll need to add a 'User Input Task' (which you can think of as a 'container' for a form you want to display); and then you'll need to add your form to this (make sure you've added the 'result' as a rule input to your form and set it to the correct data type and made it an array!)

    When you import the form to your User Input Task Appian will ask you "Do you want to automatically create node inputs to match your interface's inputs? " and you should say 'Yes' to this. This will create a variable in the context of the User Input Task that will be mapped to the rule input of your form (it;s worth noting that a rule input on an interface is NOT a variable! It acts as a reference, or a 'pointer' to a variable which, in this case, is the variable in the User Input Task that Appian has just kindly created for you!)

    Now you need to get the value from your process variable into the variable in the User Input Task, so go to the 'Inputs' tab of your User Input Task and in the 'Value' drop-down pick the process variable that holds your data.

    This should get you to where the form now displays the data you've retrieved in your process.

    Good luck!

Children