I've defined a CDT as a Multi Value. At run time I will have 'n' instances of the object.During runtime I wish to update a specific field for one of the instances of the object but I'm not seeing how to address the field correctly.
I cant use array[1].field as that's only addressing the first instance. So for example I have at run time the multi Value CDT with the values :
Instance1 Instance2 Instance3
Field1(Text) A D G
Field2(Text) B E H
Field3(Boolean) true false false I want to change Instance3 Field 3 from false to true. How to address it because when we modify the value of CDT, it is just updating in the first instance and I am not able to pass the count of the instance
Discussion posts and replies are publicly visible
Please post a screenshot and/or code for what you're currently trying in your process model - I can't tell based on just the detail you've provided here.
I am modifying the highlited variable, but email Details have 3 instances and it is modifying it in the first instance. How do i get it to modify it in the second instance, For ex i want to add/modify in emailDetails[2].hasAutoHeaders.
emailDetails is a Multiple value variable. I am not getting the option to add in the second instance in output tab too.
Can i use stored at index of in output tab, if yes can you help me with how?
Thanks.
You can make it emailDetails as Array for that just click on the multple check box and in the output tab stored values just pass data back to PV (emailDetials).and also As i understood that you want manipulate multiple instances so for that you can use updateDictionary in the script task after data back to PV if im not wrong .
if im wrong please elaborate your actual scenario with screenshots
Thanks
Hi gangadharr0001, emailDetails is a CDT
I want to enter headersPresent variable in the instance of emailDetails, when i am trying to do that by the following expression rule it's adding the headersPresent in the first instance of emailDetails.
For example: As the emailDetails is multi-valued it is coming as -
[fromId=parul@abc, fromName=, toIds=, ccIds=, bccIds=, subject=, attachments=, body=, latestBody=, hasattachments=, emailid=, hasAutoHeaders=true],[fromId=xyz@comp, fromName=, toIds=, ccIds=, bccIds=, subject=, attachments=, body=, latestBody=, hasattachments=, emailid=, hasAutoHeaders=false]
It is changing the hasAutoHeaders to true in the first instance as you can see when it should change the hasAutoHeaders to true in the second instance.
Please read the above main explanation.
"
Field3(Boolean) true false falseI want to change Instance3 Field 3 from false to true
Hope its clear now. Thanks
You try below code .You need to use in updatedictionary in script task
a!localVariables( local!a: { {fromId:"parul@abc", fromName:"test", toIds:1, ccIds:23, bccIds:2, subject:"sd", attachments:1, body:12, latestBody:12, hasattachments:12, emailid:2, hasAutoHeaders:true}, {fromId:"xyz@comp", fromName:"test", toIds:1, ccIds:2, bccIds:3, subject:"sd", attachments:2, body:1, latestBody:1, hasattachments:21, emailid:12, hasAutoHeaders:false}
}, local!b:true, a!forEach( items: local!a, expression: updatedictionary( fv!item, {hasAutoHeaders: local!b} ) ) )
parula0001 said:emailDetails is a Multiple value variable.
The node input needs to be configured that way also. I can tell from your screenshot that it isn't. Gangad's comment earlier is correct, you would need to check the "multiple" checkbox for it in the node input configuration.
However it's probably easiest to do this processing in the Data Output tab, as I mentioned earlier, using a solution along the lines of what Gangad posted in the more recent comment.
If the change you need will be relatively simple though, you can probably get away with just using the data outputs tab to write a new value directly into the array member and field in question. Configured like this:
(note, i'm using a random CDT from my system, your property names etc will be different, but the configuration is otherwise the same).
Thanks Mike and Gangadhar for your help.