Constraining a Data Grid on a Current Object

0
Hi I am trying to build a wizard flow for the creation of records. I have 2 associated entities Contact and Address, which is a one to many relationship. When I am on the page creating address I want to be able to cycle through the creation of multiple addresses and show the data grid of the addresses created so far. I have tried using a micro flow, but there are other associated attributes that I want to show and I can't figure out how to make the linkages via the micro flow and the data grid will only show the direct attributes of the list returned from the micro flow. I have looked at the %CurrentObject% but cannot figure out how to constrain against the Address Object which is the calling object for the page. Ideally I want to constrain on the '[%CurrentObject%]'/Contact_Address.contact but that just shows errors in the expression. Alternatively does anyone know where there is worked example (ie a video or pictures) showing the way to build up a list with all the associated attributes to pass from a micro flow to the datagrid? Many thanks.
asked
2 answers
1

Sean

Assuming your new address has an association to the contact set, I believe this will do what you want:

[Addresses.Address_Contact/Contact.Contact/Addresses.Address_Contact = '[%CurrentObject%]']

So you are traversing 'up' the association to the attached Contact and then back 'down' the association to the Addresses attached to that Contact. If you would like to exclude the Address record you are currently editing from the datagrid, you could add

[....  and id != '[%CurrentObject%]']

Hope that helps.

Mike

answered
0

I am assuming your contact is the encapsulating view for the addresses datagrid, in that case, the XPath would look something like this:

[Core.Contact_Address = '[%CurrentObject%]']

Make sure to change the module name and association name to match your situation but this should allow you to retrieve all addresses belonging to a certain contact. Be aware that all objects need to be committed to the database for this to work.

answered