My object looks like this:
{
"project_code":"VC-2222",
"project_product":"ENGINE WATER PUMP",
"phaseList":[
{
"phase":"DR20",
"phase_progress":"0",
"phase_target_date":"30/09/2018",
"phaseId":1,
"taskList":[
{
"task":"Kick-Off Meeting",
"responsible":"Sales",
"task_target_date":"",
},
{
"task":"Rank Setting",
"responsible":"Sales",
"task_target_date":"",
}
]
}
]
}
I need to update, for example, the fields "responsible" that are inside each taskList nested array.
I tried to use something like
${update_field( project_pattern, {"phaseList[0].taskList[0].responsible":{"responsible":"Luiz Tomaz"}}, "projects", "false" )}
But it created a new array at the end of the object instead of update the responsible field from first "taskList"
What Am I doing wrong?
Could you provide some examples?
Thanks in advance
Luiz Tomaz
--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/ba526144-999b-4e4a-9382-14f138e16956%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.
-----------------------
Dear Pranchi
I think there is a misunderstand. I never opened a thread on Sales Force because I don't have an account on Sales Force. I received an invite to join today but there is no password and the recovery e-mail never arrived. So, I kindly ask you to please, keep the topic opened everywhere. I understand your concern to avoid duplicated questions on different platforms but the issue itself is more important at this moment.
In case support team confirm there is a limitation to retrieve/update data when using nested arrays on a collection, with no workaround using Freemarker, we are in trouble because most of our system's functions were designed to work this way and there will be not time to change it without cause an impact on delivery date to customer.
Best Regards,
Luiz Tomaz
I've done some work with jsons and freemarker, there's a method available for it:
https://docs.runmyprocess.com/API_Reference/FM/Utilities.html#P_json_put
Since phaseList and taskList are arrays, you may need to enter them specifically, but if all of them should have the same value then it gets a little easier:
<#list phaseList as phase>
<#list phase.taskList as task>
<#assign task = P_json_put(task, "responsible", "Luiz Tomaz") >
</#list>
</#list>
I have not tested the above, but I hope you can understand how it should work from it.
Good Luck!
Svensson, Peter
--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/b8eb7e3e-0a71-4d4f-964d-efdb14650d72%40runmyprocess.com.
I could solve this issue working with Array index + positional $ operator.
It worked fine and now I can updated an specific field in a collection even if the field is inside a nested array (2nd or 3rd level)
You can close the topic.
Regards,
Luiz Tomaz