Forum Discussion

Jacky_Phan's avatar
Jacky_Phan
Ideator I
6 years ago

Is this possible if get an ItemType inside another query within AML?

I have two ItemTypes Person and Address. There is a property Person.address_id that stores the config_id of an address, for a particular purpose it is just a string type, not refer ItemType. I use below query to select a person (*):

<Item action='get' type='PERSON' select ='address_id'>
 <id>'abcdxyz'</id>
</Item>

I want to add some AML code to get Address Item with the id provided in above statement, something likes:

<Item action='get' type='ADDRESS'>
 <id>The (*) query that returns an address id</id>
</Item>

I know that we can achieve the goal by writing a server method, but I just curious is there any way to get that within AML query?

Many thanks,


9 Replies

  • Good day.  I'm not sure what you are trying to accomplish.  Are selecting a PERSON & then using the PERSON ID to get the address?  I'm under the impression that the PERSON & ADDRESS are related in some fashion.  Can you provide a little more info on this?  Thanks.

  • This should be possible by using the "where" attribute.

    <Item action='get' type='PERSON' select ='address_id' where='[PERSON].id=...'>

    </Item>

  • Can you try this?

    <Item type='ADDRESS' action='get' where="[ADDRESS].id in (select address_id from innovator.PERSON where id= 'abcdxyz')"></Item>

    • Jacky_Phan's avatar
      Jacky_Phan
      Ideator I

      Hi Jay,

      The id= 'abcdxyz' is just an example, it should be passed in as an parameter in parent select statement: address_id

  • Can you try this?

    <Item type='ADDRESS' action='get' where="[ADDRESS].id in (select address_id from innovator.PERSON where id= 'abcdxyz')"></Item>

  • Nice information, thanks for sharing. I want to share one thing with you, I got a $500 gift card by participating in the customer feedback survey at DQFanFeedback