Get Element Attribute in Data Design
Last updated
Last updated
Get Element Attribute in Data Design
is an output block that allows you to retrieve the value of any HTML attribute in elements that were generated using the Content from Data Design block and dynamically added to the page or form.
The output is of type text and is compatible with Value Parameters of type text or of type any.
The behavior of the block is similar to the Get Element Attribute block, with some important differences:
Element Selection: You can only choose an element placed inside the selected Data Design element.
Works only with elements generated using Content from Data Design block that are dynamically added.
The block consists of the following (from top to bottom):
Attribute: Value Parameter that accepts a text value representing the HTML attribute to set or change the value of.
Data Design: Selectable Input to choose the Data Design element whose element you want to target.
Element: Selectable Input to choose the element, within the selected Data Design, you want to get the attribute of.
ID: Mandatory Value Parameter that accepts a text value representing the unique value that was provided to the Content from Data Design block.
ID2: Optional Value Parameter that accepts a text value representing the secondary identifier that can be used to identify the desired element. See below for more details.
NOTE: Please refer to the prerequisite information shown here before seeing the example.
The image below shows an example in which the variable a is set to the value of the href attribute of the Link element (Company Link) within the selected Data Design element.
The above example will result in the variable a being set to https://company2.com
(the URL of Company 2).