Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
a!localVariables( local!metadataJSON: if( a!isNotNullOrEmpty(ri!metadataJSON), a!fromJson(ri!metadataJSON), null ), local!result: a!forEach( items: local!metadataJSON, expression: a!localVariables( local!section: fv!item, a!forEach( items: local!section.questions, expression: a!localVariables( local!questionrow: fv!item.questionrow, a!forEach( items: local!questionrow, expression: if( fv!item.questiontitle = ri!targetField, updatedictionary(fv!item, { "responsetext": ri!value }), null ) ) ) ) ) ), local!metadataJSON )
I have a nested json. I need to update its field "responestext" if its questiontitle is equal to the parameter. Then return the new json. But the original variable metadataJSON is not updated. Is there any function to update the origin value?
Discussion posts and replies are publicly visible
Can you paste the JSON here as code for better debugging?
[ { "customkey": "", "sectioninstructions": "", "sectionparent": "root", "questions": [ { "customkey": "", "rowlabelstyle": "", "rowlabel": "CV Submission", "questionrow": [ { "customkey": "", "ismandatory": "", "questiontooltip": "", "questionid": 1, "readonly": "", "questioninstructions": "", "questiontitle": "CV Upload", "responsetype": "recordaction", "responsevalue": "", "responsetext": "", "parentid": 1 } ] } ], "sectionlevel": 1, "nestedjson": "", "sectionstyle": "bold", "sectiontype": "card", "collapsible": true, "sectionname": "Questionnaire", "objectid": 1, "parentid": 0 } ]
This is the json. I need to update the "responsevalue" for the item in the "questionrow"
What are the values of targetField and value Rule Inputs?
targetField is "CV Upload".Value is a string. You can set it anything