This flow is triggered on a form submission from a Webflow site. The form data has the ZIP code and city. If the ZIP code already exists, its CMS item (for weather) is updated. Otherwise, a new CMS item is inserted.
Weather information is retrieved from a third-party service through an API call. "Simple HTTP", a Byteline built-in feature to execute any HTTP call, is used to make this call.
Byteline's built-in feature "Webflow - Upsert Items" is used to update or insert the CMS items through an easy configuration. The item (ZIP Code) is updated or inserted based on whether the Slug value already exists. No additional logic is needed to figure out the ID to be updated.
This demo shows tomorrow's weather by ZIP code. The shown ZIP codes, along with their weather, are stored in the Webflow CMS. You can add or update weather for a ZIP code by entering it in the first text box (which automatically populates the city). If a ZIP code already exists, that entry is updated. Otherwise, a new CMS item is added.
ZIP code auto-completion and "Add or Update Weather" button are implemented using Byteline no-code backend APIs.
Byteline is used to build a backend logic without coding by configuring a flow. In the above case, here is the flow used to add or update CMS items corresponding to a ZIP code weather. If the ZIP code already exists, its weather is updated. If not, its weather will be added. Click on the below image to see the details.
This video shows how the Byteline flow was created to get the weather from an HTTP call, then add or update the Webflow CMS items. The slug value is used automatically by Byteline to determine whether to add or update.