Logic app boolean is being automatically set as True

Copper Contributor

Hi, I am having a strange issue in my logic app and was wondering if anyone had any ideas about what is going on. The goal of my logic app is to add machine tags to our devices for Department, Subdepartment, and Role and in the step in the screenshot, I want to iterate through the current machine tags and check if it already has the tag in question and if it does, check if its up to date + update it and if it does not have the tag, add it.

img1.png

  1. I have a boolean variable to determine if the tag is present or not and have it reset it to false by default for every iteration
  2. This is a condition that iterates through the tags and checks if it there is a tag that starts with "Department:"
  3. If the tag does, the status variable will be marked as true
  4. Lastly, based on the status, it will determine what tagging action to take.

However, in step 2 and 3 the status never gets set to True, but says it is True in step 4

img2.png

These are the current tags for the device in the run in the screenshot. Subdepartment and Role exist, but not Department.

3 Replies

FYI - these are the contents of this section:

img3.png

I would post this to a Logic App group where you could get better responses.

@jams_k8 
I would switch to the code view and look at the code for the expressions.

I have seen situations where you set an expression in the GUI, such as "variable contains xyz", but when switching to the code view, the code itself says "variable contains <nothing>".

In this case, I was able to fix it by editing the code. (ie adding the "xyz" in the above example"

 

May or may not be related to what you are seeing, but might be worth checking.