Satisfying input schema

                                                    When sending single items of data to a service, you can quite easily use the input properties of the 'create record' operation of that services connector.

                                                    As per the following example of receiving single customer payloads via webhook and sending them to Google Sheets via 'create row':

                                                    However, sending data in single calls is not always feasible.

                                                    You may have a large batch of data which needs to be sent.

                                                    If you were to loop through a batch and send each item individually, you may quickly run into problems with the API rate limiting in the destination service.

                                                    When sending data in batch format to a service or database, you may find that there are particular 'input schema' requirements in terms of how the data is structured.

                                                    For example a SQL database (e.g. MS SQL) may require that data is sent in a 'flat' format (i.e. no 'nested' objects)

                                                    Or a service has a 'batch update' operation with very specific requirements as to how the data is formatted.

                                                    You also may find that you are having to deal with dynamic data payloads, whereby the fields that are coming through are different each time. Therefore the approach in the above example will not work as we don't know that the fields coming through will be 'Name' and 'Phone'.

                                                    Service input schemas
                                                    Copy

                                                    How to determine input schema
                                                    Copy

                                                    When using certain operations you may need to pass data payloads from previous steps as input.

                                                    For example, you may have a list of new accounts that you want to add to Salesforce which are in the format of a simple list and need to be transformed into a list of key / value pairs in order to be accepted by the Salesforce API:

                                                    The operation to do this is Salesforce's 'Batch create records':

                                                    To find out the exact input schema for this operation we can do a hardcoded test run using the Salesforce connector in the Tray Build UI:

                                                    To save time we can also head to the Tray Operations Explorer dev tool (beta)

                                                    For any connector and operation, you can use this to view automatically-generated dummy input payloads.

                                                    From looking at the Salesforce operation above we know that we want the list format for the 'Batch create list':

                                                    You can highlight and copy the dummy batch create list and open up the Tray data transformer tool (beta)

                                                    This tool allows you to enter a JSON payload in its current and desired format and get a script (which can be pasted directly into the builder) to perform the transformation.

                                                    So you can:

                                                    1. Paste your data in its current format into the 'Input JSON' field

                                                    2. Paste the desired format into the 'Output JSON'

                                                    When you have generated the script you can then copy the 'Builder snippet code' and paste it into your workflow.

                                                    The following gif shows the entire process in action: