I added a custom field to Datasource Invoice.
I would like this field to be populated automatically when the invoice is created by concatenating a fixed string and the ID field of that invoice.
Is it possible to do this?
Solved! Go to Solution.
@stefanomurino unfortunately, Zuora does not internally have the concept of "formula" fields where it can be calculated to combine some static content with another field.
Depending on your use case there are a couple ways to handle this:
a) If your intent is to show this on the invoice PDF itself, then you can concatenate your static text within the template and avoid the need for a separate field entirely.
b) If you are using the field elsewhere and actually need it to be filled in, then you would have to develop some external code to fill it in when an invoice is created. The workflow for this would be:
1. Invoice is created
2. Zuora makes a callout to your external script (i.e. could be a Cloud Function or other serverless option)
3. Your script uses the Zuora API to update the invoice field with the concatenated value.
Re: Fill in a custom field of Invoice automatically when the invoice is created
Hello, thanks for your response.
I wanted to avoid using an external script to update the datasource, but since you can not do otherwise I will do so!
Thank you very much.