How to pass the field value in API

how to pass a dataset value in API as a string parameter ?

Schema “Quote”

API

If you see the schema ,status field is dataset and i want to pass the status in API

e.g.https://my.api.mockaroo.com/quotes.json?key=XXXX&status=Submitted
the above eg API will give me the records whose status is Submitted

Harish,
I am unable to access your schema “Quote” but I think I understand what you are trying to do. If you are wanting to use an URL parameter as the value to a column then you should use the following.

Schema: https://www.mockaroo.com/10be7960

Contains a field, Status that is of Formula type. The formula being used is request_params[‘status’]

The Mock API url looks like this: https://my.api.mockaroo.com/3118.json?key=xyxyxyxy&status=Completed

Result:
id,Status 1,Completed 2,Completed 3,Completed 4,Completed 5,Completed 6,Completed 7,Completed 8,Completed 9,Completed 10,Completed

Hope that helps you out.

Thanks for the reply ,and i got your point but I want the status column to be dataset so that when i pass the status Submitted in the API then it matches the values in dataset and then give me the records.
If I add request_params[‘status’] then anything/dummy can be passed.

Harish,
Ahhhh, I see what you are trying to do. Let’s see if this helps you out -

Schema: https://www.mockaroo.com/10be7960

DataSet:
status,type,value,price
Submitted,Foo,Good,5.00
Cancel,Bar,Negative,0.00
Exception,Cookie,Excellent,100.00

Mock API: https://my.api.mockaroo.com/3118.json?key=xyxyxyxyx&status=Cancel

Response:
Cancel,Bar,Negative,0.00

The schema is where you will need to perform the from_dataset() function.

Thanks,
Rich