Good Morning ,I know it is not complex, but I cannot find the most optimal way. I have the following rule that I call from an interface.
But I need to return directly to the interface a string as follows.
20202,20203
Thank you very much
Discussion posts and replies are publicly visible
Hi Alex
A two-step process will give you what you need:
Step 1: use fn!index() to extract the actual values
Step 2: use fn!joinarray() to splice the values together with the separator of your choice
a!localVariables( local!myArray: { {idSecurityMaster: 20202}, {idSecurityMaster: 20203} }, fn!joinarray( fn!index(local!myArray,"idSecurityMaster"), "," ) )
I've NOT included any handling for circumstances where the values maybe null, or the array returned doesn't contain any 'idSecurityMaster' dictionary items...
Thank you very much for your time Stewart, it works perfectly
You're welcome. Half the battle in Appian is trying to find the right functions, and the other half is breaking down your problem into a set of smaller problems.
I'm sorry StewartAnother question, at the end the first rule that obtains the values I left it as in the first img
Because the results of the rule I need to put using the in operator in another rule, but it shows me the following error.
Thank you
When you run 'SAN_ST_GetListAssetsByPortfolio' what type of data does that return? The error message is saying you can't use the 'IN' operator (which will always be a list) to compare the field 'securityMaster' to the values returned by this rule.
Yes, it is clear that it is due to the data type. In the first image you can see on the right the result of the first rule which is List of text string, which I think is the one needed by the IN operator
If the data types are different you can coerce (cast) one or both of them to be the same type before applying the operator.
Thanks, i used the split function, it seems to work fine. Once again thanks for your time