for each item in input.Items
{
barcode = item.Barcode;
query = Map();
query.put("cf_barcode",barcode);
fetch_item = invokeurl
[
url :"https://www.zohoapis.eu/books/v3/items?organization_id=" + organization_id
type :GET
parameters:query
connection:"zoho_oauth_connection"
];
// info fetch_item;
search_items = fetch_item.get("items");
if(search_items.size() > 0)
{
////// Item found with barcode ////
inventory_item_id = search_items.get(0).get("item_id");
get_by_id = zoho.books.getRecordsByID("Items",organization_id,inventory_item_id,"zoho_oauth_connection");
// info get_by_id;
item_details = get_by_id.get("item");
custom_fields = item_details.get("custom_fields");
rate = item_details.get("rate");
for each field in custom_fields
{
if(field.get("label") == "Make")
{
make = field.get("value");
}
if(field.get("label") == "Model")
{
model = field.get("value");
}
if(field.get("label") == "Machine Type")
{
machine_type = field.get("value");
}
if(field.get("label") == "Shipping Class")
{
shipping_class = field.get("value");
}
}
item.Make = make;
item.Model = model;
item.Machine_Type = machine_type;
item.Shipping_Class = shipping_class;
item.Sales_Pric = rate;
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter