how to put 2 conditions but with different actions

how to put 2 conditions but with different actions

  

I want to add a condition where if the device is the same then the user id will be updated, is this true?

Hello Erron,

Could you explain with more details what you want to achieve?
What do you mean by "device being the same" and what do you mean by "update the user id"?

Cheers

Eduardo Jauch wrote:

Hello Erron,

Could you explain with more details what you want to achieve?
What do you mean by "device being the same" and what do you mean by "update the user id"?

Cheers


in my condition, i want to update user id when the device id is same. but, in that picture the condition doesn't effect to my app

In your IF condition you're doing 2 comparisons.

User Id and Device Id.

But you're connecting them through an OR. So, any one that comes true, and the if will follow the true path.

If it is not following it, than both id and device comparisons are returning false.

Execute in debug the code so you can check the values to find the error.

Cheers.

Solution

Hello Erron,

If I am understanding your problem correctly, then to achieve what you want you should be using below condition.

identify.UserId != GetIdentifies.List.Current.Identify.UserId and identify.MobileId = GetIdentifies.List.Current.Identify.MobileId

This way if for current record the mobile id matches and user id does not, the above condition would proceed to "true" branch and there you can add an action to update the UserId.

And to insert the record on the "false" path for above condition you may have to add another "if" with below condition.

identify.UserId != GetIdentifies.List.Current.Identify.UserId and identify.MobileId = GetIdentifies.List.Current.Identify.MobileId.

Hope it helps!

Solution

Junaid Ahmed Syed wrote:


still can't because in statement (color blue) it's for insert/update device if user same, and i want to add new condition before this(color blue), that check which statement should go. [another statement for insert/update user if device same]

Hi Erron,

So what's holding you back modifying this code? Perhaps I misunderstand, but it seems you're stuck at very elementary programming, instead of having a specific question about some specific topic?