在Azure数据工厂中测试多个If条件并针对活动进行字符串相等性测试 [英] Test multiple If condition in Azure Data factory and string equality test for the activities

查看:86
本文介绍了在Azure数据工厂中测试多个If条件并针对活动进行字符串相等性测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Azure数据工厂中测试字符串值.
基于此String值,我的管道将被触发.

I want to test a string value in Azure data factory.
Based on this String value my pipeline would get trigger.

我正在从自动化Runbook收集此值作为参数.
如果参数值为"Nike",则返回"Nike".然后耐克管道将触发,其他一些管道将触发. 如果条件具有两个选项-

I am collecting this value as a parameter from automation runbook.
If the parameter value is "Nike" then Nike pipeline will trigger and else some other pipeline. The If condition having two options-

  1. 真实活动
  2. 虚假活动

因此,如果参数与指定值不匹配,则我的错误块将被触发.
但是我有多个值,因此True/False条件不能满足我的要求.

so if the parameter does not match with a specified value then my false block would get trigger.
But I have multiple values hence True/False condition will not suffice my requirement.

所以我的第一个问题是-我们可以在ADF If条件活动中测试多个条件,以便与特定管道匹配的任何String值都将被触发,如果不是,那么哪个活动将被触发我应该使用.

So my first question is- Can we test more than one condition in ADF If condition activity so that whichever String value it matches that specific pipeline would get trigger, if not so then which activity should I use.

我的第二个问题是-:如何测试参数值的相等性,以便可以触发指定的管道.
下面的代码,我尝试过但抛出错误. @equals(pipeline().parameters.clientName,'Nike')
请注意-clientName是参数名称

My second question is- How do I test the equality of parameter value so that I can trigger the specified pipeline.
below code I have tried but thrown the error. @equals(pipeline().parameters.clientName,'Nike')
Please note- clientName is the parameter name

推荐答案

您是否尝试过"Switch"(切换)?活动?

Did you try "Switch" activity ?

请参见以下链接: https://www. sqlservercentral.com/blogs/switch-activity-in-azure-data-factory-container-with-many-ifs

这篇关于在Azure数据工厂中测试多个If条件并针对活动进行字符串相等性测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆