6 Replies Latest reply on Nov 27, 2018 7:09 AM by Roger Palmen

    Dynamic Reference in AF

    Archit

      Hi,

       

      I am trying to use dynamic tag name by referencing to an element only with attributes of tag prefixes and asset name etc.

       

      My issue is that I have to mention the absolute path and it doesn't help when moving to a different country.

       

      Like:

      Here Sankofa is under Ghana and for Avg (Tag), I have used string builder but there is an absolute path for Asset_Config\Asset and \Prefix. The problem occurs when I use the same for VDA under Italy, as it gives the same values and refers to the same absolute path. Whereas I would ideally want specific values for Italy.

      This is Asset_Config defined only for string builders.

      The templates are common.

      This the template for Asset_Config Element.

       

      Need help guys, let me know if I need to explain more in details.

        • Re: Dynamic Reference in AF
          Roger Palmen

          Hi,

           

          It's not really clear to me why you need to use absolute paths, but a common way i solve this is to 'copy down' the prefix values using string builder.

          So from Asset Config to OCTP, and then from OCTP to Sankofa. So for an attribute 'Asset' on Sankofa, copy the value from OCTP using '..\Asset_Config|Asset', and then use that in your Tag attribute.

           

          PS: The use of the "Asset_Config" element seems a bit odd to me. Why not place these attributes directly under OCTP? Asset Config hints at a set of attributes, so i would use a category for that and not an Element. That would also simplify the 'copy down'.

          4 of 4 people found this helpful
          • Re: Dynamic Reference in AF
            Jaison_Rodrigues

            Hi Archit,

             

            As Sebastien already mentioned, you can always use relative path instead of absolute path, if you have "Asset_Config" element at the same level.

             

            Also, I observed that the last part of tag is your Element Path. Instead of using "%..\..\..Element%.%..\..\Element%" etc. you can simplify it by using "Replace("%ElementPath%","\",".")". "String Builder" is pretty powerful and provides functions to play around with the string. Since you have most of the strings that are required to build the tag name in the Element Path, I would suggest that using the functions of String Builder, you can eliminate using "Asset_Config". For rest, you can use AF Lookup Table.

             

             

            Regards,

            Jaison Rodrigues

            2 of 2 people found this helpful