Andy6966317
Posts: 0
Joined: Fri Jul 04, 2014 2:39 am

how to pass a String into an Array to create a list of the strings.

What I was trying to do was store a list of member firstName, lastName, and ID.
Later I was going to use a list service on the firstName and lastName in order to populate a list component with all of the members in a group.

The embedded fields were an attempt to create categories that I could choose to list later.

As you can see, I need help.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

how to pass a String into an Array to create a list of the strings.

Andy,

As members is an array, so you can store there only primitive data types. In your case the best suits JSON string.
In Settings delete all embedded fields from members.
Remove binding to members parameter in mapping, instead add the following code to this parameter:
pre
var value = {};
value.firstName = localStorage.getItem("firstNameOfUser");
value.lastName = localStorage.getItem("lastNameOfUser");
value.ID = localStorage.getItem("userID");
return {"__op":"AddUnique","objects":[JSON.stringify(value)]};/pre

Return to “Issues”