Extract specific piece of text after a certain point

Hello all, hello @J805 ,

I have implemented a QR reader within my app which reads a QR code which I created to corresponds to the unique ID of one of a number of possible data types. The QR scan can be done on my mobile site or natively using the BDK Native inbuilt QR scan function on the native app version.

At present I do a search on each of the Data Types for which I have QR codes separately, and then navigate to a view depending on where it finds a match to the unique ID (I am not sure this is the most efficient way to to do this but I didn’t know if I can search across data types to find a unique ID).

Anyway it does work. However I realised I needed to redesign this to be able to read in QRs from an external QR reader too. So I have saved a test QR code content which instead of holding “123456789” holds “https://app.mysite.com/venue?qr=123456789”.

And this now works as I want by extracting the QR from the URL.

However I need the original scanners within the app now to cut out the “https://app.mysite.com/venue?qr=” part and leave me with just the unique ID. I have saved a custom variable on the venue page which holds the domain “https://app.mysite.com/” and appends a “version-test/” when not in live, but I don’t know what the text function/syntax would be to extract just the unique ID. I guess I should also add that I may want other variables in the future too so I guess I need to extract to the end or to an “&” character depending on which comes first.

Any ideas on how I can do this?

Thanks a lot,
David

PS thanks for the Option Sets video @J805 , it was very helpful. Wish I knew about using these when I started developing this app. Anyway they will get used when I come back and do a major tidy.

PPS we got our app accepted to both Play Store and App Store this week. Onwards and upwards :grinning:

1 Like

If you can get to the whole URL, why not do a :findandreplace - replace your entire url with blank, leaving only the ID to :converted to number

If you have more parameters later then you could do multiple find and replaces for the text chunks before and between your variables, replace with a delimiter, and go :converted to list

1 Like

This sounds perfect @richard10 however I don’t see how to access this functionality (sorry probably a very basic question). If you had a sample syntax too that would be hugely helpful. Thanks

ok I got to the bottom of that and it worked as you described @richard10 though I will have to revisit when I get to adding multiple parameters to see how to do what you describe around the extra variables. I wonder if the variables might be different in different instances if it would still be workable, e.g. ?qr=123&var1=on OR ?qr=987@var2=off

The next issue I have on this is around Firebase because the external QR reader brings me to the correct page on the website but ideally it should be doing that for the app so I need to find a way to either create Firebase links automatically when I generate QR codes or have some sort of generalisable Firebase links (I have no idea if this is even possible) like “https://app.mysite.com/venue?qr=*” where it can handle these as a type of link. Anyway time to dig into Firebase to find out, if anyone has any ideas or tips for this I would be very grateful.

Thanks again,
David

Hey
I’d assumed that if you’d generated and handed out the QR codes, that you could make the URLs have a level of consistency with the order your other variables show up in.
Good luck with Firebase!
R

Thanks @richard10 . I can look into that, perhaps have them read into some array and pull out the details according to the name of the variable? Anyway one thing at a time.