Condition Statement and IF expression in Azure LogicApp

Lubdha Dolas 121 Reputation points
2021-04-20T14:27:48.45+00:00

1.Condition statement for String is not working as expected.

it had to fail when the string in contains but it's passing.

89470-image.png

I am trying to filter for No Rows according to the schema generated.

  1. If condition I want to print Y is the column has N
    value": "@if(item()['dataCells'][2]?['label'])"
    I think this is incorrect
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,543 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lubdha Dolas 121 Reputation points
    2021-04-21T06:40:59.61+00:00

    @ChaitanyaNaykodi-MSFT still not able to get the If statement.

    I want to achieve

    If row label is Y then I want to output as No, in that Row

    I wrote: @if(equals(item()['dataCells'][2]?['label'], Y), 'no', 'yes')"

    I think instead of equal I need to use string compare not sure can u guide

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Lubdha Dolas 121 Reputation points
    2021-04-20T14:57:59.72+00:00

    I fixed this with a condition.


  2. Lubdha Dolas 121 Reputation points
    2021-04-21T07:07:16.647+00:00

    may be if

    (equals(item()['dataCells'][2]?['label'], 'Y'), 'no', 'yes')"
    this will work

    0 comments No comments

  3. ChaitanyaNaykodi-MSFT 27,476 Reputation points Microsoft Employee Moderator
    2021-04-27T06:58:02+00:00

    Hello @Lubdha Dolas , apologies for the delay. You can use the the string function in the following manner if(equals(string(item()['dataCells'][2]?['label']), string(Y)), 'no', 'yes')". Please let me know if this does not help resolve the issue, I will be glad to continue with our discussion.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.