PowerApps - 基于数据库数据将藏品分为较小的集合
我问题的简短形式:是否有一种方法可以根据SQL数据库条目将集合分为几个子收集?
更新
好吧,也许是一个更简单的版本。我真的在为此而苦苦挣扎...
我从一个集合开始: scandatacollection_smartcomm_masterlist
它看起来像这样:
Result
REQ1991799.RITM2280596.01
REQ2048874.RITM2349401.01
REQ2037354.RITM2335400.01
我有一个数据库表: master_transaction_log
...具有三个特定兴趣的列:
Timestamp
Scan_Code
Transaction_Type
我想以两个 collections:
SC_ReturnToDepot
Result
REQ1991799.RITM2280596.01
SC_Remainder_1
Result
REQ2048874.RITM2349401.01
REQ2037354.RITM2335400.01
标准如下:对于任何给定的结果 scandatacollection_smartcomm_masterlist ,如果:
数据库记录具有scan_code =结果和和和 transaction_type =“新设备交付 - CUST。MSG:设备返回depot” 和和 and 和 and and and and timestamp> 72小时前,然后将结果值添加到 sc_returntodepot
sc_remainder_1 均为所有剩余值不符合上述标准。
到目前为止,我到目前为止都在杀死我:
ClearCollect(SC_ReturnToDepot,
ForAll(ScanDataCollection_SmartComm_MasterList,
...?
);
);
我有一种感觉,我是否可以钉住一条一行代码,我参加了比赛,但这是只是...嗯,我的大脑在混蛋。
- = - = - = - = - = - = - = -
更长的详细说明:
我正在尝试创建一个机制,该机制从物理场内过程中获取扫描代码列表(在架子上的框上扫描代码),并为每个代码进行扫描,并查看SQL数据库表( Master_transaction_log ),寻找该代码。它创建了另一个集合,其中包括那些以独家时尚的相关扫描代码。
高级别:
Collection scandatacollection_smartcomm_masterlist ,其中包含一个列结果,必须分为下面的七个不同列表。这些列表在中是一个特定的序列(因为我们以特定序列发送通信):
收集名称: scandatacollection_smartcomm_smartcomm_returntodepotimmed - 标准 - 标准:如果数据库中有一个条目 scan_code =给定的扫描代码的表超过48小时。 - 注意:技术人员将被指示立即将该物品放入外向的垃圾箱中进行拾取。 - 数据注意:此扫描代码不得包含在此列表中的此下方的任何集合中。
收集名称: scandatacollection_smartcomm_announounoununounoununoununoununoununoununouncoremovalofem - 标准:如果数据库表中有一个条目,其中 scan_code =给定的扫描代码=“新设备交付-Cust。MSG:最终警告”,其中 Timestamp 年龄大于48小时。 - 注意:客户会收到这些物品的电子邮件,宣布将这些物品退还给仓库。 - 数据注意:此扫描代码不得包含在下面的任何集合中 此列表上的这个。
收集名称: scandatacollection_smartcomm_sendfinalwarning - 标准:如果数据库表中有一个条目,其中 scan_code =给定的扫描代码,其中 transAction_Type_type =“新设备交付-Cust。MSG:警告”,其中 Timestamp 的年龄大于48小时。 - 注意:客户收到了这些物品的电子邮件,宣布这是他们接机的最后机会。 - 数据注意:此扫描代码不得包含在此列表中的此下方的任何集合中。
收集名称: scandatacollection_smartcomm_sendfirstwarning - 标准:如果数据库表中有一个条目,其中 scan_code =给定的扫描代码=“新设备交付-Cust。MSG:提醒”,其中 Timestamp 年龄大于48小时。 - 注意:客户收到了这些物品的电子邮件,宣布这是警告他们的警告。 - 数据注意:此扫描代码不得包含在此列表中的此下方的任何集合中。
收集名称: scandatacollection_smartcomm_sendreminder - 标准:如果数据库表中有一个条目,其中 scan_code =给定的扫描代码,其中 transAction_type_type =“新设备交付-Cust。MSG:第一次联系”,其中 Timestamp 年龄大于48小时。 - 注意:客户收到了这些物品的电子邮件,宣布这提醒您收集订单。 - 数据注意:此扫描代码不得包含在此列表中的此下方的任何集合中。
收集名称: scandatacollection_smartcomm_sendfirstContact - 标准:如果数据库表中有一个条目,其中 scan_code =“新设备交付 - 在Stockroom/Tech Bar接收”。 (注意:没有时间延迟 - 到达位置时应该立即出现) - 注意:客户收到这些电子邮件,宣布订单可以接收。
收集名称: scandatacollection_smartcomm_noactionTaken - 标准:根据先前的逻辑规则,尚未将给定的扫描代码(结果)添加到上述任何项目中。例如,可能已经发送了一个提醒,但仅在十个小时前发送,所以我们在此项目上不采取任何行动
。
这些集合中的每一个都只需要一个列:结果。 重要的是,没有单个扫描代码居住在一个以上的集合中 - 它们是为了解决升级通知顺序的构建。例如,对于已经在货架上持续一个星期的物品的扫描代码可能已经发送了第一次联系,发送的提醒和发出警告。它必须仅进入 scandatacollection_smartcomm_sendfinalwarning 集合,因为该集合中的所有项目都将发送最终警告。
我已经编写了程序的一部分,这些部分生成并发送了适当的电子邮件(包括家用,这是一个难以破解的坚果)。我认为我需要的只是能够将我的主集合分为这些子收集,然后我可以简单地使用自己的forall循环来攻击每个子收集。
我非常感谢它的建议!当然,我很乐意在需要的地方提供澄清。
- = - = - = - = - = -
较大的透视图:现在,我们的技术人员在不同的物理架子上组织传入的物理盒,每天它们移动盒子的各个部分,并根据架子进行不同的通讯。例如,架子#3获取提醒,然后将所有项目移至第二天的架子#4。但是,随着我们的生产系统的加剧,每天都有更多的盒子到达。因此,我没有让技术人员根据哪个架子和每天移动数十个盒子来确定发送哪个通讯,而是希望他们扫描整个房间,然后让工具查看数据库,并确定下一个最合适的是什么通讯发送。这将每天节省大约20-40分钟。此外,在不久的将来,一旦该系统运行良好,我计划将单个技术人员的通讯集中,而不是在每个远程位置执行此功能的每个技术。但是后来,...
Short form of my question: Is there a way to split a Collection into several sub-Collections, based on SQL database entries?
Update
Okay, a simpler version, perhaps. I'm really struggling with this...
I start with a collection: ScanDataCollection_SmartComm_MasterList
It looks like this:
Result
REQ1991799.RITM2280596.01
REQ2048874.RITM2349401.01
REQ2037354.RITM2335400.01
I have a database table:
Master_Transaction_Log
...which has three particular columns of interest:
Timestamp
Scan_Code
Transaction_Type
I would like to end up with TWO collections:
SC_ReturnToDepot
Result
REQ1991799.RITM2280596.01
SC_Remainder_1
Result
REQ2048874.RITM2349401.01
REQ2037354.RITM2335400.01
The criteria is as follows: for any given Result in ScanDataCollection_SmartComm_MasterList, if:
A database record has Scan_Code = Result AND Transaction_Type = "New Equipment Delivery - Cust. Msg: Equipment Returning to Depot" AND Timestamp > 72 hours ago, then that value of Result is added to SC_ReturnToDepot
SC_Remainder_1 are all remaining values that do not fit the above criteria.
I got as far as this so far, but it's killin' me after this:
ClearCollect(SC_ReturnToDepot,
ForAll(ScanDataCollection_SmartComm_MasterList,
...?
);
);
I have a feeling if I can just nail that one single line of code, I am off to the races, but this is just... ugh, my brain is being a jerk.
-=-=-=-=-=-=-
Longer more detailed explanation:
I'm trying to create a mechanism that takes a list of Scan Codes from a physical in-field process (scanning codes on boxes on a shelf), and for each Code, and reviews a SQL database table (Master_Transaction_Log), looking for that code. It creates another Collection that includes those associated Scan Codes, in an exclusive fashion.
At a high level:
Collection ScanDataCollection_SmartComm_MasterList, which contains one column Result, must be split out into the seven different lists, below. These lists are in a specific sequence (because we send communications in a specific sequence):
Collection Name: ScanDataCollection_SmartComm_ReturnToDepotImmediately - Criteria: If there is an entry in the database table where Scan_Code = the given Scan Code, where Transaction_Type = "New Equipment Delivery - Cust. Msg: Equipment Returning to Depot" and where Timestamp is older than 48 hours. - Notes: The technician will be instructed to immediately place this item into an outgoing bin for pickup. - Data Note: This Scan Code must not be included in any Collection below this one on this list.
Collection Name: ScanDataCollection_SmartComm_AnnounceRemovalOfItem - Criteria: If there is an entry in the database table where Scan_Code = the given Scan Code, where Transaction_Type = "New Equipment Delivery - Cust. Msg: Final Warning" and where Timestamp is older than 48 hours. - Notes: The customer receives an email for these items, announcing that the items will be returned to the Depot. - Data Note: This Scan Code must not be included in any Collection below
this one on this list.Collection Name: ScanDataCollection_SmartComm_SendFinalWarning - Criteria: If there is an entry in the database table where Scan_Code = the given Scan Code, where Transaction_Type = "New Equipment Delivery - Cust. Msg: Warning" and where Timestamp is older than 48 hours. - Notes: The customer receives an email for these items, announcing that this is their last chance to pick them up. - Data Note: This Scan Code must not be included in any Collection below this one on this list.
Collection Name: ScanDataCollection_SmartComm_SendFirstWarning - Criteria: If there is an entry in the database table where Scan_Code = the given Scan Code, where Transaction_Type = "New Equipment Delivery - Cust. Msg: Reminder" and where Timestamp is older than 48 hours. - Notes: The customer receives an email for these items, announcing that this is a warning to pick them up. - Data Note: This Scan Code must not be included in any Collection below this one on this list.
Collection Name: ScanDataCollection_SmartComm_SendReminder - Criteria: If there is an entry in the database table where Scan_Code = the given Scan Code, where Transaction_Type = "New Equipment Delivery - Cust. Msg: First Contact" and where Timestamp is older than 48 hours. - Notes: The customer receives an email for these items, announcing that this is a reminder to collect their order. - Data Note: This Scan Code must not be included in any Collection below this one on this list.
Collection Name: ScanDataCollection_SmartComm_SendFirstContact - Criteria: If there is an entry in the database table where Scan_Code = the given Scan Code and where Transaction_Type = "New Equipment Delivery - Received at Stockroom/Tech Bar". (note: no time delay -- this should go out immediately upon arriving at a location) - Notes: The customer receives an email for these, announcing the orders are ready to pick up.
Collection Name: ScanDataCollection_SmartComm_NoActionTaken - Criteria: The given Scan Code (Result) has not been added to any of the items above, based on previous logical rules. For example, a Reminder might have been sent, but it was sent only ten hours ago, so we take no action on this item.
Each of these COLLECTIONS only needs a single column: Result.
It's important that no single Scan Code reside in more than one collection -- they are built to address an escalating notification sequence. For example, a Scan Code for an item that has been on a shelf for a week may already have a First Contact sent, a Reminder sent, and a Warning sent. It must ONLY go into the ScanDataCollection_SmartComm_SendFinalWarning Collection, because all items in that Collection will be sent Final Warnings.
I already have written the parts of the program that generates and sends the appropriate emails (including householding, which was a tough nut to crack). I think all I need is to be able to split my Master Collection into these sub-Collections and then I can simply attack each sub-Collection using its own ForAll loop.
I would dearly dearly appreciate advice on this! And of course, I'm happy to offer clarifications where needed.
-=-=-=-=-
Larger perspective: Right now, our techs organize incoming physical boxes across different physical shelves, and each day they move sections of boxes and perform different comms based on shelf. For example, Shelf #3 gets Reminders sent, and then all items are moved to Shelf #4 for the next day. But as our production system ramps up, more boxes arrive each day. So instead of having the technicians determine which comm to send based on which shelf, and moving dozens of boxes each day, I just want them to scan the entire room and then let the tool look into the database and decide what is the next most appropriate comm to send. This will save them about 20-40 minutes a day. Furthermore, in the near future, once this system is working well, I plan to centralize comms from a single technician, instead of each tech at each remote location performing this function. But later, later...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论