Page 2 of 2

computing list fields

Posted: Wed Jul 24, 2013 10:40 pm
by hugues.aubuchon

Hello John,

I'm trying to do almost exactly the same. Can you share how you did it ?

I'm not sure I understand how to deal woth the data object fron OnSuccess. If there are multiple records returned (Array), how assign individual fields in a List for example (with the concatenation of two fields).

Thanks !

Hugues


computing list fields

Posted: Thu Jul 25, 2013 2:02 pm
by Kateryna Grynko

Hi,

The answer comes as an array as well as the first parameter of Success handler and will be available within a handler as "arguments [0]".

Further processing of the answer depends on the format of the response.


computing list fields

Posted: Thu Jul 25, 2013 2:39 pm
by hugues.aubuchon

Thank you Katya for the quick response! I think I finally got it.

If I understand, there is no way right now to access the value of other fields in the field mapping js.

The only way I can concat multiple fields in a single element is to have a event on OnSuccess (or Complete) of the datasource, and access the data object using: Appery('myfield').text ou .html() to assign the display value of my field.

Example:
code
Appery('myAddress')&#46;html('<strong>' + data&#46;customer[0]&#46;address + '<&#47;strong><br&#47;>' + data&#46;customer[0]&#46;city);
/code
This works for me.

Is this the easiest solution ?


computing list fields

Posted: Fri Jul 26, 2013 1:12 pm
by Kateryna Grynko

Hi,

Yes, this is a good solution. If it works, why not?


computing list fields

Posted: Tue Oct 08, 2013 10:34 pm
by Doug

How could 3 query values be concatenated? Example: City, State Zip

Would I map all three to one label and then run JS to combine?


computing list fields

Posted: Tue Oct 08, 2013 10:36 pm
by maxkatz

Map each to a different local storage variable. Read the values and create the string that you need.