【问题标题】:No data output in Zapier when running a Python Code block and inputting a list运行 Python 代码块并输入列表时,Zapier 中没有数据输出
【发布时间】:2021-02-28 02:23:44
【问题描述】:

我正在从 Zapier 中的上一步获取我认为的列表,然后尝试将该列表与字典(在代码中)进行比较,以将一个值或一组值作为新列表返回。我已经在我的桌面上成功测试了它,但它不会在 Zapier 中产生相同的输出。

我的上一步采用逗号分隔的列表并使用Utlities 格式化程序返回一个列表。我的错误可能是我假设这是一个列表。

我假设这是一个列表并将其用作Run Python 步骤的输入。

当我对此进行测试和审查时,结果没有错误,但也没有数据。任何关于我如何确保我理解传入数据的见解都会很棒。

Zapier 测试

list = []
for arg in input.values():
    sharefile={
    'Explore! Archaeology': 'https://hectv.sharefile.com/xxxx',
    'Explore! Life as a Dog': 'https://hectv.sharefile.com/xxxx',
    'Explore! Economics': 'https://hectv.sharefile.com/xxxx',
    'The big chicken': 'https://hectv.sharefile.com/xxxx'
    }
    for index, (key, value) in enumerate(sharefile.items()):
        if arg == key:
            print(f'{arg} was matched')
            list.append(value)
return(list)

【问题讨论】:

    标签: python-3.x zapier


    【解决方案1】:

    在 Zapier 工作人员的帮助下,他们解释说输入始终是文本。每个输入行是一个字典条目。

    因此,要访问我的第一行也是唯一一行数据,我必须使用:

    items = input_data['input']

    这会返回一串数据。

    我希望这可以帮助任何人解决这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-12
      • 2017-07-30
      • 2016-03-15
      • 1970-01-01
      • 2023-01-30
      • 1970-01-01
      相关资源
      最近更新 更多