I have a main data source
myFields
SKUIntroductionGroup
Asset (repeating)
Calc
SiteManager
I have a secondary data source "Lookups"(xml) (which I use for the multi selection list values for Asset in the main data source)
Lookups
Assets
Asset (repeating)
Site
And a second secondary data source "GetWhosWho"(dataconnection from SP)
row (repeating)
Email
Role
Region
I want to put the correct email into my field SiteManager. Selecting Email from GetWhosWho, and filtering on the Region - where Region is equal to the Site (in lookups) - and the Site (in Lookups) has a parent (Asset) which matches the first Asset selected in the main data source. (Convoluted huh!)
So to build up to my requirement - I have created an expression box to pull out the first asset in the main data source.
my:SKUIntroductionGroup/my:Asset[. != "" and 1] and this works fine (call this first asset)
I have then created an expression box to pull out the site of the first asset in the main data source
xdXDocument:GetDOM("Lookups")/Lookups/Assets/Asset/@Site[xdXDocument:get-DOM()/my:myFields/my:SKUIntroductionGroup/my:Asset[. != "" and 1] = ..]
this does not work as I expected - my xml is obviously not right. If I tick items on my list going downwards it seems to work ok
but if I tick the items in a bizarre order - it always picks seems to sort on the Lookup list rather than the main data source.
e.g. if the LookupList is
Asset A site siteA
Asset B site siteB
Asset C site siteC
Asset D site siteD
And in the multi selection box I select in the order
Asset A
Asset B
Asset D
then my expression box brings me siteA
If in the multi selection box I select in the order
Asset C
Asset B
Asset A
my expression box brings me siteA but my "first asset" expression box brings me Asset C
Obviously I cannot move on to my next level of complexity until I have figured this one out. I have been trying various things for the last couple of hours, some inspiration from an xml expert would be gratefully received. (I cannot use the display name/value option in the multi selection box as I want to store the asset not the site)
Thank you.
Catharine