Skip to content

On demand · Product video

Connect Quality Inspector tests to a new table with Power Automate

For quality managers and Business Central administrators who want tests on records that are not set up out of the box, such as lot number information.

Recorded May 31, 2023 · 13 minutes

Quality Inspector tests on any table video thumbnail

Summary

Quality Inspector can run tests against a table it does not connect to out of the box, using a new source configuration. The video creates a quality inspection template that records length, width, and height with pass conditions, then adds a source configuration that maps the item, variant, lot number, and custom fields from the lot number information table to the test, with no document involved. It builds a Power Automate flow that adds a Create Test on Lot Number action to the lot number information card, and a test generation rule that tells the system which template to use. Running the action creates a test with the mapped fields filled in.

Key topics

  • Create a quality inspection template with pass conditions
  • Map fields from a new table with a source configuration
  • Add a Create Test action to a page with Power Automate
  • Set a test generation rule for the new table
Read the transcript

In this example we’re going to walk through creating a new quality inspection template, connecting it to a table that isn’t set up out of the box, and using Power Automate to add a built-in action to any of those pages. The very first thing we do is make the test itself. We navigate to Quality Inspection Templates, create a new template, and call it Lot Information Example, because we’re going to pass this over to the lot number information card.

We add a new field called length. This will be a number, 1 to 200 is allowed, and perhaps 1 to 30 is our pass condition. Then we add width and do the same thing, perhaps with 5 to 60 as our pass, and then add height as a range of numbers, where we’ll allow all the way up to 99. So it’s a very simple test, collecting length, width, and height with some pass conditions.

In most scenarios, the source configurations that come out of the box will work for typical receiving, and even some shipping and production. If you want to connect a completely new record, we navigate to Quality Inspection Source Configurations. Here’s a list of out-of-the-box connections, which basically tell the system what to map and how. In our example, we’re going to bypass a document entirely. When we create a test off of this, it won’t relate to any document; it’ll be directly on the item and lot number.

To do that, we create a new source configuration and call it Lot Information Example. For the from table, we choose the lot number information table, and we connect it to a test. Inside that test, we map the fields we know about: the item number, the variant code, and the lot number, to the source item, the source variant, and the source lot. You’ll notice you don’t need to put in things like the document number, because you don’t have to have them. A scenario here would be an ad hoc test that isn’t related to any particular process, where you want the test associated with the lot number only, with no link to the document that might have triggered it.

Just for fun, we’ll also copy the description over to a custom field. You can also copy over custom values. For example, we could copy over Test Quality, which is a built-in Business Central field, and map it to any of the special fields we have. If you’re using Source Custom 1, 2, 3, and so on, it grabs the caption from that field, so if we put in Test Quality here, it displays as Test Quality. We can also copy the exact same field again, put it in Source Custom 3, and give it a different caption, Example Caption, to show how you can change it.

Now we have a source configuration ready for lot number information, and the question is how you actually get it to create that test, automatically or manually. This is where Power Automate comes into play. Let’s go through the manual example. We navigate to the lot number information list, and let’s say we want the test on the card instead. We’ll give this one an example description so we can see a description get copied over, and we want an action on here to create that test.

We go to Power Automate and create a flow. I’m switching to my development environment and the Examples company. We use the Business Central naming for the page and its number, which I grab from the URL. For the selected record, we then create a test. We head to Business Central, find the Run Action action, change to Insight Works Quality Inspection, and choose the action name. Now we can see all the actions available. These are effectively all the dispositions you can do through Power Automate in this context: you can assign it, block the lot, create a retest, reopen a test, move inventory, and so on.

We’ll create the test from the record, which is the system ID of that record, and the table name is lot number information. You could also put in the table number, which you can get by inspecting the page; it’s table 6505. Both the name and the number will work. We name the flow Create Test on Lot Number and save it. This is a manual action for that selected record, on this page specifically.

If you wanted the create test action available from any page at all, you could remove the page, since it’s optional, and pass in the table ID as a parameter, so it’s the table ID for whatever record you’ve selected.

At this point, you’ll notice we haven’t specified the template or any other criteria. All we’re telling the system is to go create a test from this record. To tell the system exactly which test to use and when, we use the test generation rule. One way to get there is through the quality inspection template. We find that template and click Test Generation Rules, and here we’re saying you can do this on lot number information under any circumstance. If you only wanted this test created when, say, the test quality is bad, you could add that condition. We’ll leave it with no condition, so pressing the button makes a test.

To summarize: we have a quality inspection template with the fields we want to collect. Associated with it, we have a test generation rule for lot number information. Lot number information is available because we told the system what to do with that record in the source configuration, where we see what field maps to what on the test. Lot number information is pretty simple, and this is an example without a document. If you’re doing this with a document, you’d add the field related to the document number, for example a certificate number, and map it to the source document number.

So now if we open lot number information, we should see an action on the card. We navigate to our lot number information list, find our example, and under Automate we see Create Test on Lot Number, which comes from Power Automate. We click it, choose Continue, and run the flow. If you’re curious, you can open the flow runs page to see whether it passed or failed, but in this case we can see it called back into Business Central in less than a second.

Let’s navigate to our tests and see what it did. Our test has been created using the Lot Number Information template code, and we can see how all of the fields mapped: there’s the item number, the lot number, and our length, width, and height. So in just a few minutes, we created a configuration that told the system how to map the fields, and we told the system how to create the test manually through Power Automate.

Questions about this webcast?

Send your question and the Insight Works team will reply by email. Ready to plan a project? Contact your Microsoft Partner.

Ask a question

Webcast Questions