none
(ADF V2) How to check if "First" Item() value in "For Each" IS NULL

    Question

  • How to check if "First" Item() value in a "For Each" activity IS NULL or some specific value.

    Wednesday, July 11, 2018 8:05 PM

All replies

  • Hi,

    To check whether an item is some specific value, you can use IF Condition activity in ADFv2, reference: https://docs.microsoft.com/en-us/azure/data-factory/control-flow-if-condition-activity

    Foreach activity uses '@item()' to reference each item in collection, I'm afraid we couldn't identify whether an item is the first item only relying on foreach activity.

    This post https://docs.microsoft.com/en-us/azure/data-factory/control-flow-if-condition-activity may give you some help.

    Thursday, July 12, 2018 12:16 AM
  • You could set isSequential to true. Then the loop will be executed sequentially and you will get the first item().

    Do you want to break out for each loop in some cases? If so, I don't think there is a way.


    Thursday, July 12, 2018 2:34 AM
  • Thanks to all that answered.
    Friday, July 13, 2018 2:18 PM