If Statement Help for Commerce

  • 9 February 2024
  • 2 replies

Userlevel 2


I wanted to get some help with some code in the commerce connector. My client has a Shopify store with a connection to Amazon. All Amazon orders display a Tag of ‘Amazon’ in the Shopify Order Tags along with a few other tags that are autogenerated. I’m trying to import ‘Amazon’ to one of the Acumatica SO fields anytime ‘Amazon’ appears as a tag and leave the field blank if it does not. Here’s what I have some far, which worked once, but does not seem to work everytime.

=IIf(InStr([OrderData.Tags], 'Amazon') >0, 'Amazon', ' ')

Thanks in advance!


Best answer by Yuri Karpenko 9 February 2024, 18:06

View original

2 replies

Userlevel 2

That worked! Thank you @Yuri Karpenko!

Userlevel 7
Badge +6

@freddydelrio39 , I think this formula won’t work if Amazon tag is the first one in the list of tags.  Instead, you can use this:

=IIf(InStr([OrderData.Tags], 'Amazon') <> -1, 'Amazon', ' ')

-1 is what returned by the InStr formula where the value is not found.

LMK if this helped!


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved