Script has different behaviour when used in App

When running python script,

from seatable_api import Base, context
server_url = context.server_url
api_token = context.api_token
base = Base(api_token, server_url)
#Get the current table
current_table = context.current_table
current_row = context.current_row
for art_id in current_row[‘Article’]:
print(‘art_id=’, art_id)

it behaves differently
in the base :

art_id= dz3IH0PxQNCTEBGzjweq7g

in the App :

art_id= {‘row_id’: ‘dz3IH0PxQNCTEBGzjweq7g’, ‘display_value’: ‘T3752’}

How can I build code that can be used in both context (I need to get the row_id for an add_link)

We will fix the inconsistency in a future version. The second format will be used in the future.

For now, you can check whether current_row[‘Article’] is a string or an object before you use it.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.