I have a python script that contains a dictionary and when I try and load the script into Studio the Python Object returns - PythonObject { Id=[00000000-0000-0000-0000-000000000000] }
The xaml is using UiPath.python.activites
The xaml steps are Load Python → Invoke Python → Get Python
When comment out payload = {“iat”: now} the Load Step with be successful and Get will return “Hello”
Using Python 3.10.
Script def time(sa_keyfile):
import time
import argparse
import google
import google.auth.crypt
import google.auth.jwt
import requests
The work around I found was to create the dictionary and it values in Studio then convert that dictionary to a json string.
JsonConvert.SerializeObject(DICTIONARY_VARIABLE,Newtonsoft.Json.Formatting.Indented)
In the python code add
import json
To convert the json back to a dictionary in the python script
jsonTodict = json.loads(jsonPayload)
To change any of the value datatype in the dictionary
jsonTodict[‘iat’] = int(jsonTodict[‘iat’])