Home > Mobile >  byNames() and byName() in Azure DataFlow,How to use them in which scenarios?
byNames() and byName() in Azure DataFlow,How to use them in which scenarios?

Time:11-22

I want to use byName() and byNames() in my flow.But I am not getting exact usage of it like am not finding any examples / scenarios . The Examples given by Azure are not clear. Please help .

CodePudding user response:

  • byName() searches for a column in a given stream name (stream name is optional). Look at the following example. Let's say you have source data as in the following image:

enter image description here

  • I have added another column called team with value as og using derived column transformation.

enter image description here

  • Now consider you want to populate a column based on whether it exists or not. If there is no column with given name, null values are returned. I used the following dynamic content in derivedColumn1 transformation,
 toString(byName('team'))

enter image description here

  • I get the following output:

enter image description here

  • Since we have given team as a column, it populated each row of new column with corresponding team column value. Instead of giving team, if we give any other column name that does not exist, then the entire new column will be populated with NULL values.

  • byNames() is similar to byName(). Instead of giving a single column, you give an array of column names. The following dynamic content is an example where I have given array of column names, along with stream (optional argument).

array(byNames(['gname','team'],'source1'))

enter image description here

  • I got the following output:

enter image description here

  • Here I am searching for columns gname and team in the stream source1 (which has only id and gname columns). Since we are looking to get a column where it does not exist, it has populated the new column with NULL. If all the given column names exist, the values are populated accordingly.
  • Related