Skip to main content
Solved

If Statement Help for Commerce

  • February 9, 2024
  • 2 replies
  • 86 views
  • Translate All

Forum|alt.badge.img

Hello!

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

@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!

View original

2 replies

Yuri Karpenko
Captain II
Forum|alt.badge.img+7

@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!

Translate

Forum|alt.badge.img

That worked! Thank you @Yuri Karpenko!

Translate