VCard QR Code

267 views
Skip to first unread message

Tiffany Waggoner

unread,
Oct 31, 2022, 5:41:25 PM10/31/22
to XMPie Interest Group
I need help/advice on how to handle a customer QR Code.
This customer has the ability to enter up to 3 phone lines, and select a descriptor for each phone. I currently have phone1 set to Work, and phone 2 to cell, but the user can really select any descriptor from a list of about 7 drop down options. How would I program that in to the below?

XMPBarcode("QRCode", "BEGIN:VCARD\nFN:" & @{VAR_NAME} & "\nN:" & @{VAR_NAME} & "\nTITLE:" & @{VAR_TITLE1} & "," & @{VAR_TITLE2} & "," & @{VAR_TITLE3} & "," & @{VAR_TITLE4} & "\nORG:" & "Packaging Corporation of America" & "\nADR;TYPE=home:;;" & @{VAR_ADD1} & ";" & @{VAR_ADD2} & "\nTEL;TYPE=work:" & @{VAR_TEL1} & "\nTEL;TYPE=cell:" & @{VAR_TEL2} & "\nEMAIL:" & @{VAR_EMAIL} & "\nEND:VCARD", "Color=cmyk(0%, 0%, 0%, 100%);BackgroundColor=cmyk(0%,0,0,0)")

Thanks in advance!

Tiffany

couch

unread,
Oct 31, 2022, 6:05:13 PM10/31/22
to XMPie Interest Group
If you refer here:
https://www.iana.org/assignments/vcard-elements/vcard-elements.xhtml
you will find that the "TEL" parameter can have these type values:
work, home, text, voice, fax, cell, video, pager, textphone, main-number

So, in uStore as well as letting the customer enter their phone numbers, let them also select a descriptor from a drop down (use text to make a human understandable option, and the value to be one of the above types.). Make the descriptors variables as well and add the descriptors into your code like this:

XMPBarcode("QRCode", "BEGIN:VCARD\nFN:" & @{VAR_NAME} & "\nN:" & @{VAR_NAME} & "\nTITLE:" & @{VAR_TITLE1} & "," & @{VAR_TITLE2} & "," & @{VAR_TITLE3} & "," & @{VAR_TITLE4} & "\nORG:" & "Packaging Corporation of America" & "\nADR;TYPE=home:;;" & @{VAR_ADD1} & ";" & @{VAR_ADD2} & "\nTEL;TYPE=" & @{descriptor1} & ":" & @{VAR_TEL1} & "\n TEL;TYPE=" & @{descriptor2} & ":" & @{VAR_TEL2} & "\n TEL;TYPE=" & @{descriptor3} & ":" & @{VAR_TEL3} & "\n  EMAIL:" & @{VAR_EMAIL} & "\nEND:VCARD", "Color=cmyk(0%, 0%, 0%, 100%);BackgroundColor=cmyk(0%,0,0,0)")


(Note that the code example is a quick copy/paste and needs to be checked more carefully, but gives you the idea of how to add the descriptor.)

Tiffany Waggoner

unread,
Nov 1, 2022, 2:42:34 PM11/1/22
to XMPie Interest Group
Thank you so much! A few tweaks and now working like a charm.

This one seemed to be the keeper for me.

XMPBarcode("QRCode", "BEGIN:VCARD\nFN:" & @{VAR_NAME} & "\nN:" & @{VAR_NAME} & "\nTITLE:" & @{VAR_TITLE1} & ", " & @{VAR_TITLE2} & ", " & @{VAR_TITLE3} & ", " & @{VAR_TITLE4} & "\nORG:" & "Packaging Corporation of America" & "\nADR;TYPE=home:;;" & @{VAR_ADD1} & ";" & @{VAR_ADD2} & "\nTEL;TYPE=" & @{VAR_DESC1} & ":" & @{VAR_TEL1} & "\nTEL;TYPE=" & @{VAR_DESC2} & ":" & @{VAR_TEL2} & "\nTEL;TYPE=" & @{VAR_DESC3} & ":" & @{VAR_TEL3} & "\nEMAIL:" & @{VAR_EMAIL} & "\nEND:VCARD", "Color=cmyk(0%, 0%, 0%, 100%);BackgroundColor=cmyk(0%,0,0,0)")

Reply all
Reply to author
Forward
0 new messages