Sandata Workato Scripts.

This commit is contained in:
Norm Rasmussen
2024-06-18 16:31:27 -04:00
parent a8ac05e460
commit 06af9a492e
6 changed files with 177 additions and 17 deletions

View File

@ -5,7 +5,7 @@ import Apikeys
import json
APIKEY = Apikeys.ANTHOLOGY
APIKEY = Apikeys.SANDATA
groups_dict = {}
pp = pprint.PrettyPrinter(indent=4)
@ -27,16 +27,17 @@ def get_groups(APIKEY):
# if created_at.startswith("2023"):
group_id = response["id"]
group_name = response["attributes"]["name"]
# print(group_name)
groups_dict = {group_name: group_id}
groups.append(groups_dict)
if "caregiver" in group_name:
# print(group_name)
groups_dict = {group_name: group_id}
groups.append(groups_dict)
if "next" not in nextlink:
break
print(groups)
with open(
"/Users/normrasmussen/Downloads/Anthology-Groups.csv", "a+", newline="\n"
"/Users/normrasmussen/Downloads/Sandata-Groups.csv", "a+", newline="\n"
) as csvfile:
for group in groups:
for key, value in group.items():