POST with Sub-Nodes; Deep Insert with REST API

I want to build a form to create Tickets in my backend system.

Payload that I need to send from AppGyver:

{
    "Name": "Confirmation for Quote 20187706",
    "ServicePriorityCode": "3",
    "ServiceRequestTextCollection": [
        {
            "Text": "The customer has confirmed a quote. Relevant Quote: 20187706",
            "TypeCode": "10004"
        }
    ]
}

I’d like to know how I can structure the data schema in order to match the ServiceRequestTextCollection with [brackets]. I have tried Object type but it didn’t give me the brackets. When I tried list of objects, it did not let me bind to my input field.

Any ideas?

Indeed the solution was to use list of objects type.

However I couldn’t bind data variables directly as I’m filling out a text form with a single text field. So I used a page variable and bind it instead.

1 Like

How did you bind the page variable to the text collection? BR, Fabian.

I have a regular text variable, for creation I had to build a formula like the following:

{Name: data.CreateTicket.Name, BuyerPartyID: appVars.PortalUser.AccountID, DataOriginTypeCode: "4", ServiceIssueCategoryID: data.CreateTicket.ServiceIssueCategoryID, BuyerMainContactPartyID: appVars.PortalUser.ContactID, ServiceRequestTextCollection: [{TypeCode: "10004", FormattedText: pageVars.TicketText}]}

Thanks for your response. We solved it via the described page variable of type object that includes now all fields required for the odata call to create a ticket in c4c. We changed the mapping in the create record flow function to the each attribute of the page variable. Many thanks for your support.

2 Likes

Hello everyone,

Thank you for your Question and Answer regarding Deep Insert with REST API.
Also I tested Deep Insert and confirmed successful result.
But from my side, there is a hurdle to handle for the variable sub-nodes or multiple sub-nodes like below image.
I’m looking for the solution(workaround) to deal with it, please share your experience or clue.

thanks and Best regards
Jungwoo.

Hi! Use List of Objects type, select List first and then Object :slight_smile: