|
Rank: Newbie
Joined: 5/4/2013 Posts: 9 Location: Chicago
|
I have two questions:
1. How do I flatten the results from the 'readResults' array such that my output could just be '{id} = {v}' (eg. 'Something' = 555).
2. How to deal with multiple types of the 'v' property? Sometimes 'v' will be a string, number, or bool.... Using the string type returns nothing, but the number type does. I thought using the string type would just cast whether it is numeric or bool.
Thanks Chris
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
1) your question is not clear, and your mapping attempt feels like an overkill, but in order to be sure provide some sample input and output
2) in contrary to XML, strings in JSON have different syntax from numbers, therefore you do not get the values from string as you can do in XML. A simple workaround is to use the function substitute-missing, and connect string to "node" and number to "replace-with" - this should do the thing
|
|
Rank: Newbie
Joined: 5/4/2013 Posts: 9 Location: Chicago
|
1) Yes it is overkill. Here is the input and expected output... http://i.imgur.com/sllIVxJ.jpg
2) Let me try that.
/c
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
See 2 screenshots below. The mapping on first screenshot produces result on second. For output I used a text component with a single column vlad attached the following image(s):
|
|
Rank: Newbie
Joined: 5/4/2013 Posts: 9 Location: Chicago
|
Very cool vlad.
How would you now serialize this down to a single output result so that MFServer API could return back to calling client?
/c
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Many ways possible - one of them the File/String button in output. Read documentation for more details.
|
|
Rank: Newbie
Joined: 5/4/2013 Posts: 9 Location: Chicago
|
ah Yes.... that button.
|
|
guest |