...
Expand | |||||
---|---|---|---|---|---|
| |||||
Create a second function, APPidList(), to extract the ClientList prefixes from the custom fields and update MatchFile () to call APPidList(). You can replace the contents of the MatchRules.lua file with this new code:
Concepts used:
|
Expand | |||||
---|---|---|---|---|---|
| |||||
We can quickly do this by adding one line to AppidList( ) after line 2:
You should see something like: Concepts used: |
Expand | |||||
---|---|---|---|---|---|
| |||||
Create a third function, APPmatchPrefix(), to determine if the filename matches the prefix. You can copy the code below:
See the screenshot below and add a line to MatchFile() to call and invoke the AppmatchPrefix() function. Concepts used:
|
Expand | |||||
---|---|---|---|---|---|
| |||||
Let’s modify the code to go through the entire list of prefixes:
And this is what you should see: Concepts used:
|
Expand | ||
---|---|---|
| ||
Commit and Push Changes to Git and go to the component card for Choosing the code to run for your component. |
And You’re done! The next steps are how you could further refine the code
Expand | ||
---|---|---|
| ||
This means refining the APPidList function. That would involve looping through the list and removing white space from each ID: Concepts: |
Expand | |||||
---|---|---|---|---|---|
| See Custom Logging
| ||||
Add intuitive Custom Logging for your component to increase visibility into processing and adding meaningful messages to help with troubleshooting. You can see an example of this in main.lua on line 25:
Try it for yourself! |
Expand | ||||
---|---|---|---|---|
| See Custom Status
| |||
Add Custom Status for your component to have it display real time updates at the bottom of the component card as its running. This component already creates custom status on lines 31-36 of main.lua. Try it for yourself! |
There is no limit to how you can streamline the usage of a custom component - if that helps address a bottleneck, then it is well worth it.
...