Original Input json -
{
"demo" : "a12,b45,c78" ,
"status" : "1"
}
Expected output is xml
<demo>
<Value>a12</Value>
<Value>b45</Value>
<Value>c78</Value>
</demo>
<status>done</status>
I will first create a json and then use @xml() in logic app to convert this into xml tried like below which works fine but its hardcoded how to use foreach for dynamic.
{
{% if content.status == "1" %}
"status" : "done"
{% elsif content.status == "2" %}
"status" : "done"
{% endif %}
"demo": {"Value":["a12","b45","c78"]}
}
for demo c# code will be like -
string a = "a12,b45,c78";
var aa = a.Split(',').ToArray();