cancel
Showing results for 
Search instead for 
Did you mean: 

Use a Common Data Model as object input to a recipe function

jashmore
Deputy Chef II
Deputy Chef II

I have a CDM defined and would like to pass use that as an object input parameter to a recipe function.  Is this possible and what's the way to define it so that the object structure is retained within the function?   Thanks in advance!

2 ACCEPTED SOLUTIONS

gary1
Executive Chef III
Executive Chef III

Assuming it's JSON, you can paste an example payload into the input parameters of the function recipe and it will parse it out for you.

View solution in original post

blakesha
Deputy Chef I
Deputy Chef I

A better way if you really want to do this is just to copy the schema from the Common Data Model object

1)  First got to the Common Data Model schema you want to copy from.

2) Select "Edit Schema"

3) Copy the object(s) you need

4) In the request, select "add fields manually" from the schema designer and put in any dummy field (I just use a single string called "Test")

5) Select "Edit Schema"

6) Paste in the schema objects you copied from 3)

This works better if you have two browser windows open running side by side.

*product enhancement request* Allow us to select a Common Data Model object as schema object(s) in the "schema designer" control type in the SDK

*another product enhancement request* Implement "$ref" and "$defs" in the JSON schema

View solution in original post

2 REPLIES 2

gary1
Executive Chef III
Executive Chef III

Assuming it's JSON, you can paste an example payload into the input parameters of the function recipe and it will parse it out for you.

blakesha
Deputy Chef I
Deputy Chef I

A better way if you really want to do this is just to copy the schema from the Common Data Model object

1)  First got to the Common Data Model schema you want to copy from.

2) Select "Edit Schema"

3) Copy the object(s) you need

4) In the request, select "add fields manually" from the schema designer and put in any dummy field (I just use a single string called "Test")

5) Select "Edit Schema"

6) Paste in the schema objects you copied from 3)

This works better if you have two browser windows open running side by side.

*product enhancement request* Allow us to select a Common Data Model object as schema object(s) in the "schema designer" control type in the SDK

*another product enhancement request* Implement "$ref" and "$defs" in the JSON schema