Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Reference an Included Pointer's Values

I have a service return that has a few pointers in it, and each one is included, so it shows the entire record for that pointed-to collection. I want to be able to reference multiple values from that pointer's records like I can with the parent object, like this,

label = value.start_date + " - " + value.deadline_date;
return label;

and place the JS on a map.

Image

what would be the code to do the same thing for two fields in the employee_ptr object in that picture?

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Reference an Included Pointer's Values

Can I get some help on this please? I revised my initial question to be a little more clear.

Basically I want to map multiple components into one component, but those multiple components are from an included collection. This is shown in the picture above, with employee_ptr and job_lineitem_ptr, both being examples of included collections.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Reference an Included Pointer's Values

Hi Jack -

First try this data by returning the single value, what result will you get? You can use console.log() to check the returned values.

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Reference an Included Pointer's Values

Hello Illya, thanks for your reply.

I am now able to do this with:
value.employee_ptr.name

but I would like to be able to do the same thing with storage variables.

For example, the storage Employee will have a pointer (or defined object) of Emails within it, and inside Emails is address and group. I want to be able to reference both address and group in JS on a mapping and return the result into the field I mapped to.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Reference an Included Pointer's Values

Hello Jack,

You are able to create storage variables with such structure. What problems do you have now?

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Reference an Included Pointer's Values

I did not see that you replied to this. I apologize for such the delay. I must be missing something here.

I want storage C1. C1 is one of many variables in C, which is in B, which is in A. Does that make sense?

in other words I want variable tomato, which is one of many in the storage vegetables, which is in the storage foods.

This does not work but might help you understand what I am wanting here:

var MyVar= Apperyio.storage.selected_event.job_lineitem_ptr.get("$['_id']");

Here is the storage structure:
Image
In some cases I want to be able to go deeper in so to speak, but I hope that if I learn how to do this I can do the rest.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Reference an Included Pointer's Values

Please use:
var MyVar= Apperyio.storage.selected_event.get("$['job_lineitem_ptr']['_id']");

instead of:
var MyVar= Apperyio.storage.selected_event.job_lineitem_ptr.get("$['_id']");

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Reference an Included Pointer's Values

Excellent! You the man Sergiy!

Return to “Issues”