Closed RitaSousa09 closed 1 year ago
Hi,
Apologies for late reply. May I know if you did resolve the issue.
Hello,
No problem. Unfortunately, not.
Hi,
I tried with this script and it works
expense = Expense()
expense.setCost('10')
expense.setDescription("Testing")
expense.setCurrencyCode("USD")
user1 = ExpenseUser()
user1.setId(79774)
user1.setPaidShare('10.00')
user1.setOwedShare('2.0')
user2 = ExpenseUser()
user2.setId(33497394)
user2.setPaidShare('0.00')
user2.setOwedShare('8.00')
users = []
users.append(user1)
users.append(user2)
expense.setUsers(users)
expense, errors = sObj.createExpense(expense)
print(expense.getId())
Hello, We are trying to add an inconstant number of ExpenseUser according to the number of key:values in the previously created usersInfo dictionary, something like this:
{'349': '1,34', '396': '0,00', '345': '2,00', '409: '5,11'}
, with the key being the Splitwise user ID and the value being the owed share.Part of the code is below:
But we're getting this error:
{'base': ['There are zero people involved in this expense! Make sure to add some before saving.']}
Can you tell me what the problem could be? If I run
expense.getUsers()
befores.createExpense(expense)
, I can see the several ExpenseUser correctly.