0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【IQ Bot】カスタムロジック:Splitの根拠になる項目が変動する場合(備忘メモ)

Posted at

解説なしで、本当に備忘メモだけのページです。

Splitの根拠になる項目が変動する場合のカスタムロジック(フィールド項目)

Splitの根拠になる項目が変動する場合

def func_split(value, splitter, index):

    x = value

    if splitter in value:
        y = x.split(splitter)

        if (len(x) + 1) >= index:
            x = y[index]

    return x

### このspListの内容を、splitの根拠になる文字に変える ############
spList = ("splitの根拠になる文字1","splitの根拠になる文字2",...) 
##############################################################

for i in spList:
  x = func_split(field_value,i,1)
  if x != field_value:
    field_value = x
    break

テーブルにする場合は…… spListを回すループのところをさらに関数にして返してあげるイメージになると思います。(必要なタイミングが来たらロジック書きます)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?