Auto Follow Deep Link when Key is Scanned

Hi,

I’m printing data matrix bar codes on my shipping labels. The encoded data is the KEY column of one of my App Sheet tables. My intention is to have users scan this bar code to jump directly to the correct order. I added a menu view, which is a “detailed” view type. This view has one field and one action. The one field is the bar code, and the action performs a LINKTOROW (Action Type: go to another view within this app). I’m able to scan the bar code then click the action button to jump to the view, but I would like to be able to do this in one step (without having to click the action button). I setup a Workflow to respond to an UPDATE event for the field that is receiving the scanned bar code, but I can’t link it to the action I created, because that action is not showing up in “Data change action name” dropdown box. Is there a way to have a workflow rule run my LINKTOROW action when the bar code is scanned? Or am I approaching this problem wrong (i.e. there is a better way to link to a table row from a bar code scan). Thank you!

When you scan the barcode, it’s a form view and it’s saved right? If this scan field is the only or the last field in your form view and you set the form to Auto Save, you can assign the LINKTOROW action to this form’s Form Saved event and when the form is saved, LINKTOROW will automatically be triggered. No need for any workflow.

1 Like

Thanks for the response! The issue with this approach is that I’m using a “Quick Edit column” to edit the scan code (to save clicks), and I just tested your suggestion and it only seems to work if I edit the form directly. Any way to make this work when using a quick edit column?

@LeventK

Ok, I explored this a bit further, and it looks like maybe this solution can work. I just navigate to the form view from the menu (instead of the detail view), and with autosave it works quite well. The only issue I have is after I scan an order and jump to a view, I’d like to be able to go “back” and scan the next order, but it brings be back to the detailed view. Is there some way for the back button to bring me to the open form view instead?

Unfortunately quick edit columns does not trigger the Form Saved event.

1 Like

Turn on Auto Re-Open from the Form view’s details.

1 Like

@LeventK Thanks for the continued input. This isn’t working, as the back button still seems to be context dependent. But I just found another approach to handle the subsequent scan. In the landing detail view (that I jump to upon scan), I added a new action for “Next Scan” which links me back to the scanning form view. This allows me to pretty efficiently scan one item after the next. The only thing that would help reduce clicks would be if I could auto-open the scanner (i.e. auto edit the scan id field), when I navigate to that form view. Is it possible to do this?

@Phil_Robertson
Unfortunately auto-focus to a field or the first form field is not possible right at the moment.

1 Like

@LeventK ok, thanks for letting me know, and for your quick responses!

You’re welcome

Hello - I have been looking through this thread as I have a similar problem. Phil, were you able to get this to work?

I have tried all the suggestions shown here and still cannot get a scanned barcode to open up a detail form for a different table.

I have an order/order detail app which needs to have a weight added to each item (order detail) when it is returned to our shop. I would like to scan the barcode that was attached to each item in the field and have the app take me to the details form so I can enter the weight.

Do I need to have a table dedicated to the form used for scanning the barcode ie: ScannedBarcode?
I cannot seem to get the form to execute the LINKTOROW function.

Any assistance would be appreciated.

Cheers
Ray

You need to have a separate table i.e. ScannedBarcode with only 2 columns:

  • Key Column (set Show_if to FALSE)
  • Barcode Column (scannable)

Then create an Action for this table:


Action > data: Go to another view within this app


Use the below expression in Target

LINKTOROW(
    [ProductBarcode],
    "OrderDetail_Form"
)

In this expression [ProductBarcode] is the column from your ScannedBarcode table which I assume to be the value scanned is the Key column value of your Order Details table. If not, re-express that line with a LOOKUP()

LINKTOROW(
    LOOKUP([_THISROW].[ProductBarcode],"Oder Details","BarcodeColumnName","KeyColumnName"),
    "OrderDetail_Form"
)

Assign this action to the Form Saved event of the ScannedBarcode_Form and explicitly set it to Auto-Save

1 Like

Levent – thank you this is very helpful.

It’s almost working so I would like to fine tune it a bit and learn at the same time.

First off – I believe the Action created is App: Go to another view within this app – not Data: …… That option doesn’t show for the Data category.

I managed to get this working but had to create another view so I could register it on a menu. When I tried to set the default form (Scanner_Form in my case) I could not assign it to a menu. I created a new View called Scan To Details which is linked to the Scanner table (the table I setup for this routine). Is the Scanner_Form accessed automatically when the Scanner table is referenced in the view? Or is there a simpler way? I just pointed to the Scanner_Form from the Scan to Details form.

It’s working fine on my phone but does not auto save on my computer – not a bit issue as this will be exclusively used by phones in the field.

The last piece of the routine for me is to delete the entries from the Scanner table after each scan. Is this a workflow rule? Can I set up a different Order Details Form with this rule attached to it?

I’m really impressed with this product. For my needs right now this is saving me a load of money in development time. It is a bit of a learning curve to understand how the communications/workflow between tables is working. I have experience in database design and some supporting code formats that is hard to let go of :blush:**. Very powerful stuff.**

Cheers

Ray

You’re right, it’s totally my bad, do apologize. As you have stated, it shall be App:, not Data:

The default, system generated Tablename_Form view is created as REF type and you cannot change it unfortunately. Therefore you need to create a FORM type view for that table (which will supersede the system generated view as well) and assign it to the Hamburger Menu, which you have already setup and that’s correct.

Can you elaborate this part please? I couldn’t be able to follow really.

Actually Auto-Save shall behave the same both in mobile and desktop. Just ensure that the scannable field is the only field in your Form View.

You can create an Action in your Order Details table to delete the records from ScannedBarcodes table and assign this action to the Form Saved event of your Order Details_Form view.
This action shall be:
Do this | Data: execute an action on a set of rows
Referenced Table | ScannedBarcodes
Referenced Rows | SELECT(ScannedBarcodes[KeyColumn],[Barcode]=[_THISROW].[Barcode])
Referenced Action | Delete

2 Likes

Levent – you are the best. This is shaping up nicely.

I cannot name the scanner_form twice. So I have just used the default naming of scanner_form 2. For this routine I have ignored the scanner_form (the system generated view) and the routine works as it should. Is this the right approach? The part you asked me to elaborate on is this process. I am trying to learn what is going on with the different views. I think it is easier to just disregard that question completely :blush: – it wasn’t very clear.

Can I select all rows in my scanner table for deletion of records after scanning? Referenced Rows | `SELECT(ScannedBarcodes)```

``

Thanks again – are there courses available for more advanced topics?

Cheers

Ray

@Ray
Great to hear that you’ve got what you want and solved the issue.

Yes, sure you can. Below expression will do the trick for ya

SELECT(ScannedBarcodes[KeyColumn],TRUE)

Well, community is great knowledgebase for everyone. However, being an AppSheet Partner and Developer, we do provide training courses on demand as well with a reasonable hourly fee.

1 Like

Hey Levent – sorry for the delayed response. You’ve been a great support for me as I get this app developed. I believe I can use AppSheets to get me through the next growth stage of my business without spending a lot of money on developers. Always a plus :blush:

I have my routine ready for roll out once I get the licencing setup.

Be safe – I’m sure we will chat again in the future.

Ray

Hi Levent – I have been struggling with this for a few hours and cannot get it done. Is there a simple way to index a table field (column) so that is always shows sorted in lists? For example I have an orders table that is linked to a customers table. I would like the list of customer names sorted in Ascending order for the drop down list in my order form.

I’ve tried copying from example apps but it doesn’t do the trick. I’ve tried using the ORDERBY() function in the column setup but that didn’t work. There must be a simple way :blush:

Cheers

Ray

2 Likes

@Ray
With a small to contribution to what @Steve had already proposed, you can check this as well. ORDERBY() expression works with REF and Key Columns only.

1 Like