Solved
Get all Application objects and their respective UUID
Is there a way to get the list of all application objects we have in Appian via expression rule? I want the create a csv file with all objects and their corresponding UUID.
Is there a way to get the list of all application objects we have in Appian via expression rule? I want the create a csv file with all objects and their corresponding UUID.
Thank you everyone for your insights. This is how I was able to obtain the UUIDs and respective object name:
pip install lxml
from lxml import objectify
from lxml import etree
import xml.etree.ElementTree as ET
import pandas as pd
def parse_element(element, item, uuid_map):
# If the element has no children, store its text
if len(list(element)) == 0:
item[element.tag] = element.text
else:
# Special handling for - elements with
and
if element.tag == "item":
type_value = None
uuids = []
for child in element:
if child.tag == "type":
type_value = child.text
elif child.tag == "uuids":
uuids = [uuid.text for uuid in child.findall("uuid")]
if type_value and uuids:
uuid_map[type_value] = uuids
# Continue recursion
for child in element:
parse_element(child, item, uuid_map)
tree = etree.parse("xmlfilepath.xml") #Put the path of your xml path
root = tree.getroot()
item = {}
uuid_map = {}
parse_element(root, item, uuid_map)
print("Flat data:", item)
print("UUIDs by type:", uuid_map)
#Create the dataframe:
rows = []
for key, values in uuid_map.items():
for value in values:
rows.append({'Key': key, 'Value': value})
df = pd.DataFrame(rows)
#Export the dataframe to csv:
df.to_csv('uatUUID.csv', index = False) Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.