create_compare
Make a comparison in a space: two to twelve options — products, tools, vendors, plans, candidates — side by side on the same criteria. People see a card for each option (the pick first, with why) and a table with the criteria in rows and the options in columns, the best value in each row marked; they comment on an option or on one value. Give the criteria first (key, label, type, better, highlight), then the options, each with its values by criterion key. Every value comes from a page you read (the product page, a spec sheet, a pricing page, a review) — never from memory; give that page as source. Give null when you looked and did not find it: the table shows "Not found". Read guide topic "compare" first; check it with render_compare.
Parameters
space_idstringrequiredtitlestringrequiredsubtitlestringverdictstringcriteriaobject[]requiredShow child attributes
keystringlabelstringrequiredtypestringtext, number, money, percent, rating, yes_no.groupstringunitstringcurrencystringmaxnumberbetterstringhigher, lower.highlightbooleannotestringoptionsobject[]requiredShow child attributes
titlestringrequiredsubtitlestringbadgestringbest_forstringimagestringurlstringlink_labelstringsummarystringprosstring[]consstring[]pickbooleanwhystringvaluesobjectread_compare
A comparison as it is now: title, subtitle, verdict, its criteria (by key), its options in order with their ids (what update_compare and comment take) and values, the best option(s) per criterion, and what is missing.
Parameters
item_idstringrequiredupdate_compare
Change a comparison. Any of: title, subtitle, verdict; add_criteria (after the others); change_criteria (by key: the fields you give replace those fields, "" clears one; values must fit a new type); remove_criteria (keys, with their values); order_criteria (every key, in the new order); add_options; change_options (by id: fields replace, "" clears one, values merge — the keys you give replace those values; pick: true moves the pick to it); remove_options (ids); order_options (every id); set_values (one value at a time: option id, criterion key, value — null for not found —, note, source); clear_values (option id, criterion key: back to no value). Applied in that order, all or nothing. Every value comes from a page you read (the product page, a spec sheet, a pricing page, a review) — never from memory; give that page as source. Give null when you looked and did not find it: the table shows "Not found". read_compare first for the ids — people may have changed it.
Parameters
item_idstringrequiredtitlestringsubtitlestringverdictstringadd_criteriaobject[]Show child attributes
keystringlabelstringrequiredtypestringtext, number, money, percent, rating, yes_no.groupstringunitstringcurrencystringmaxnumberbetterstringhigher, lower.highlightbooleannotestringchange_criteriaobject[]Show child attributes
keystringrequiredlabelstringtypestringtext, number, money, percent, rating, yes_no.groupstringunitstringcurrencystringmaxnumberbetterstringhigher, lower, ``.highlightbooleannotestringremove_criteriastring[]order_criteriastring[]add_optionsobject[]Show child attributes
titlestringrequiredsubtitlestringbadgestringbest_forstringimagestringurlstringlink_labelstringsummarystringprosstring[]consstring[]pickbooleanwhystringvaluesobjectchange_optionsobject[]Show child attributes
idstringrequiredtitlestringsubtitlestringbadgestringbest_forstringimagestringurlstringlink_labelstringsummarystringprosstring[]consstring[]pickbooleanwhystringvaluesobjectremove_optionsstring[]order_optionsstring[]set_valuesobject[]Show child attributes
optionstringrequiredcriterionstringrequiredvaluestring | number | boolean | nullrequirednotestringsourcestringimagestringclear_valuesobject[]Show child attributes
optionstringrequiredcriterionstringrequiredrender_compare
See a comparison as people do: screenshots of the cards view and of the table (the window widens to show every column), plus checks — values not found or without a source, options without an image or a url, no pick or a pick without why, no highlighted criteria — and errors the page hit.
Parameters
item_idstringrequiredviewstringcards, table, both.