hugues.aubuchon
Posts: 0
Joined: Wed Jul 24, 2013 10:40 pm

computing list fields

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

computing list fields

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.

hugues.aubuchon
Posts: 0
Joined: Wed Jul 24, 2013 10:40 pm

computing list fields

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 ?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

computing list fields

Hi,

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

Doug
Posts: 0
Joined: Wed Sep 18, 2013 6:27 pm

computing list fields

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

computing list fields

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

Return to “Issues”