--- title: "Inventory Management Solution with Automations" slug: "inventory-management-solution-with-automations" updated: 2023-10-31T16:50:57Z published: 2023-10-31T16:50:57Z canonical: "support.tulip.co/inventory-management-solution-with-automations" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.tulip.co/llms.txt > Use this file to discover all available pages before exploring further. # 自动化库存管理解决方案 *本用例演示了如何为库存管理系统提供简单的机器警报。* 在本例中,我们将利用 Automations 在库存状态发生变化时更新表中的记录。 --- ## 场景 您是一名生产经理,需要管理库存并在库存不足时补充库存。当库存接近特定阈值时,您还需要对库存进行监控。但是,您不希望每小时都要手动检查库存表以监控库存水平。当满足某些条件的标准时,状态应自行更新。 ## 使用案例 ### 解决方案 在本解决方案中,我们将创建一个 Automation 来创建表格记录,以推动库存补充。只有当库存水平达到特定阈值时,才会触发自动化。我们将使用 "目标"、"监控 "和 "补货 "三种状态。每种状态都有相应的颜色:绿色、黄色和红色。该解决方案的目标是提高库存管理的可见性,并提供物品数量的实时更新。 ### 设置 我们要建立的自动化系统需要一个表来检测记录的更新。本解决方案中使用的表名为 "库存警报",如下所示: ![Inventory Alerts Table](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alerts%20Table.png) 我们还有一个应用程序,供操作员记录每个物品的库存数量。 ![Inventory Test App](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Test%20App.png) 该应用程序使用表格来反映库存变化。您可以复制这个应用程序和表格的设置,或者为您的流程创建类似的设置。 ## 创建表格记录的自动更新 首先,让我们概述一下我们要实现自动化的工作流程。从预期逻辑的流程图或图表开始,有助于确定需要配置的事件、操作和决策。 在正常生产过程中,随着零件的生产和库存数量的变化,记录的变化将触发自动化的开始。根据一些阈值标准,自动化系统会将物品的库存状态标记为三种可能选项之一:"目标"、"监控 "或 "补货"。 该工作流程的基本示意图如下: ![Inventory Alerts Use-Case Flow Diagram](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alerts%20Use-Case%20Flow%20Diagram.png) 现在我们已经确定了工作流程的路径,让我们来创建自动化。 从 "**自动化**"选项卡中选择**+ 创建自动化**,并将其命名为 "库存数量警报"。 第一个事件块是事件类型 "**表记录已更新**"。选择 "库存警报 "表。当表记录更新时,此块将运行自动化。 ![Inventory Alert - Event Block](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alert%20-%20Event%20Block.png) 事件块只是在记录更新时运行,但为了确定更新内容,我们需要检索实际记录。 为此,我们创建一个新的 Action Block 来**获取表**记录。当事件发生时,它会告诉自动化程序做一些事情。选择**库存警报**表和**记录 ID**字段。该操作块将检索整个更新记录。 ![Inventory Alert - Get Record ID](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alert%20-%20Get%20Record%20ID.png) 接下来,由于有三种状态取决于不同的条件,我们将使用 Decision Block 来设置替代路径。自动化逻辑将通过这些块来决定哪个条件为真。我们还需要创建操作块,以便在条件为真时会发生什么。 第一个决策块决定字段 "Delta "的值是否小于 0。 ![Inventory Alert - Delta Less Than 0](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alert%20-%20Delta%20Less%20Than%200.png) 在决策块下面,沿着**是**流**创建**一个新的操作块,名为**创建/更新表记录**。该操作块规定,如果条件为真,记录将更新为文本 "补充",状态颜色为红色。 ![Inventory Alert - Delta Less Than 0 Action](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alert%20-%20Delta%20Less%20Than%200%20Action.png) 现在我们有了第一个条件,让我们为备用库存状态创建其余流程。你可以选择复制区块并重新配置,或者继续添加新的区块。 新的决策块应从第一个决策块的 "**否**"流程中分支出来。该区块决定字段 "Delta "的值是否在 0 和 3 之间。 ![Inventory Alert - Delta Between 0 and 3](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alert%20-%20Delta%20Between%200%20and%203.png) 在该决策块下方,沿 "**是 "**流程**创建**一个新的操作块 "**创建/更新表记录**"。该操作块规定,如果条件为真,记录将更新为文本 "监控",状态颜色为黄色。 ![Inventory Alert - Delta Between 0 and 3 Action](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alert%20-%20Delta%20Between%200%20and%203%20Action.png) 最后,创建另一个决策块,从第二个决策块的**"否**"流程中分支出来。该决策块将决定字段 "Delta "的值是否大于或等于 4。 ![Inventory Alert - Delta Greater Than or Equal to 4](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alert%20-%20Delta%20Greater%20Than%20or%20Equal%20to%204.png) 在该决策块下方,沿 "**是 "**流程**创建**一个新的操作块,名为 "**创建/更新表记录**"。该操作块规定,如果条件为真,记录将更新为 "On Target(目标中)",状态颜色也将变为绿色。 ![Inventory Alert - Delta Greater Than 3 Action](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alert%20-%20Delta%20Greater%20Than%203%20Action.png) 恭喜您现在您有了一个完整的自动化系统,可以根据物品数量的任何变化更新表记录。完整的自动化操作应该是这样的 ![Inventory Alerts - Complete Automation](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alerts%20-%20Complete%20Automation.png) ## 更进一步:创建警报 现在,我们已经了解了库存管理的基本用例,让我们再增加一个步骤,在库存数量需要补充时设置基本警报。为此,我们只需在补货流程中添加一个操作块。 在该操作块中,选择**电子邮件**。 选择要发送电子邮件的用户。 主题是电子邮件的标题,应为紧急信息,如 "需要补充库存"。正文包含电子邮件的信息,可以是记录 ID,以便收件人知道哪个项目需要补充。 操作块配置应如下所示: ![Inventory Alerts - Replenishment Email](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/Inventory%20Alerts%20-%20Replenishment%20Email.png) 设置警报只是进一步应用此用例的一种方法。如果您有其他想法,请访问[community.tulip.co](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all)并发布您的解决方案! **Automation** **Workflow** that performs tasks in the background, without an interface. Automations run logic every time an **event** occurs. ![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Glossary/Automations1.gif) **Action Block** Type of **logic block** that manipulates data or alerts users. **Decision Block** Type of **logic block** that holds conditional logic. This logic block always has 2 branches coming out of it labeled “yes” and “no”.