My trigger: when I set a toogle to Yes in list A
I want it to create an item in List B at the condition that 1) the toogle in list A is set to Yes 2) this item does not already exist in list B.
My current flow create the item, but 15 times. it adds 15 new line items in List B.
I want to have it create only 1 item.
Solved! Go to Solution.
Hi @MattWeston365 the lenght expression uses the Get items that gets items from list B whereas the Open Points W is a column of list A. I hope this helps.
@abmI think you were pretty close to the solution when you said to enter my first two conditions into the ODATA query but I get an error because it is not a column of list B (=my Get item list). In fact, I want a condition on my trigger step list (that is, When an existing item is modified). I wish we could put conditions on the trigger step but I understand this is not an available feature yet.
I also tried to enter the condition in Apply to Each: the flow succeeds but the condition is always false (although I know it should be true).
Can you help me further?
Someone marked my post as Solved and therefore it doesn't have much visibility anymore, I believe.
Lets go back to your requirement. There are so many updates after that.
Your requirement is:
When I modify the column 'Open Points W' of list A by switching to Yes,
I want the flow to create a new item in the 'S...o ref' column of list B if it doesn't yet exit in list B.
This newly created entry should be the 'U...Nr' of the item that I modified.
Couple of questions:
(1) In list B what value you compare. Please mention List A column and List B Column.
(2) Also if it doesn't exist that means are we creating a new item or we updating a column in List B using List A value?
(3) You mentioned "This newly created entry should be the 'U...Nr' of the item that I modified". Is this U..Nr is a column in List A?
If you could answer the above that will be helpful.
Thank you @abm
(1) list A column is 'Open points W' list B column is 'S...o ref'
(2) if it doesn't exist in list B we are creating a new item in list B.
(3) this new item in list B will have the 'S...o ref' filled in with the 'U...Nr' column of list A
I tried a bit everything. both eq and ne separators for my ODATA query. both length "is egual to" 0 and "is not equal to 0" in my condition. Depending on how I set up my flow I either get multiple items created (20 items for example) or never any. What I want is 1 single item to be created when condition is met.
Hi @Dricc ,
Please see below steps which I created and it is working as expected.
First I created two lists. ListA and ListB
ListA, I have created one column called 'Open points W' which is a check box (Yes/No) and another text column called UNR.
List B, I have created a text column called SRef. SRef value is updated from ListA column UNR when the new item gets created in ListB.
Next step is to build the flow steps:
Here our trigger is when ListA item is created or modified.
Next step is check Open points W is set to 'Yes'
Next we will have flow step Yes and No conditional branches. If it's no we don't have to do anything. So we are not going to add any steps under the No branch. All of the below steps are added under the 'Yes' branch. There are couple of steps here. Here is the preview of the steps. Below I will show the detailed steps.
So under the above Yes condition the first step is Get Items. Here we need to find whether List B SRef exists by checking SRef equal to UNR. Here I am setting the filter query and top count to 1. Just incase if there are more than one record we don't need to return everything. All we want is whether a record exists or not.
Next step is the Compose statement. So here we need to find the record count. As you can see below it's an expression. Copy and past the below expression including double qutoes under the input box.
Next we need to add another condition to check the record count.
Naturally we get another Yes/No flow branch. So for count > 0 we don't have to do anything. See below.
Under the No condition we need our final flow step which is create item. Here I am mapping the title and SRef values from ListA. Feel free to change the mapping accordingly.
Let me know how it goes.
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.
Hi @Dricc ,
You need to remove the Apply to each loop. There are no records under the No condition so the "Create item" won't be executed.
Try to delete that loop and add the create item. See whether that works or not.