How do you get Id of the record in another list that has the same one as a value?
Application Type
Traditional Web

I'd like you to give me some advice on how to implement the logic like below.


I have these kind of lists.   VisNodeInputList and FilterOutList (id, label, DataLabel is attribute.)


I'm trying to implement the process like below ,but it doesn't work and I'd like you to give me some advice.

I can't assign the value of id to a Local variable.



The logic(Pink area) that I'm implementing is like this. 

If VisNodeInputList has the same label attribute as FilterOutList.Current.Datalabel , I want to assign that id of VisNodeInputList to a Local variable(IdOfVisNodeList). I debugged and cheked what's wrong but after listIndex server action, the debug came to halt. I couldn't figure out why.

When I open in browser, I got Internal error.



Do you have any ideas to implement the above logic?

I'd appreciate it if you could tell me some advice.

Best,

Hi Tsuba,

Please check the attached OML for the implementation. I have implemented the ad-hoc if loop to solve the internal error which we were getting for using ListIndexOf() in ForLoop.


Now it's working completely fine.

Cheers!


Regards,

Nikhil

VisJSNetworkSampleRestored.oml

Thank you! This is what I want. Sorry for the late reply.

But I'm curious about one thing.

Why do you set TextToLongInterger(IdOfVisNodeList) in Set Edges here?

Do I have to convert text type to LongInterger type?


I just thought all I do here is "VisEdgeInput.to=IdOfVisNodeList".

I wonder if there is any special reason..I'm hung up on it.


I look forward to your reply.
Best,

All you need to do is:

  1. Run a for loop on FilterOutList.
  2. ListIndexOf(VisNodeInputList , FilterOutList.Current.Label)
  3. If Output posistion of ListIndexOf is -1 then
    1. True: Keep the for loop going on,
    2. False: LocalVariable = VisNodeInputList[ListIndexOfPosition].Id

It will work for you, I can share if you need OML for this. Let me know if you need more insights.

Regards,
Nikhil

Thank you!

I gave it a try but. it didn't work. I debugged and I found out the debug doesn't proceed after "listIndexOf" action.

I attached my OML for your information, also this OML has dependencies with this Forge Component VisJSNetwork. You need to add this Forge component in Manage dependencies.


I have no ideas why but I will retry .

It'd be nice if you could tell me where I'm mistaking.


Regards,

Tsubasa


VisJSNetworkSample.oml

Hi Tsuba,

Please check the attached OML for the implementation. I have implemented the ad-hoc if loop to solve the internal error which we were getting for using ListIndexOf() in ForLoop.


Now it's working completely fine.

Cheers!


Regards,

Nikhil

VisJSNetworkSampleRestored.oml

Thank you! This is what I want. Sorry for the late reply.

But I'm curious about one thing.

Why do you set TextToLongInterger(IdOfVisNodeList) in Set Edges here?

Do I have to convert text type to LongInterger type?


I just thought all I do here is "VisEdgeInput.to=IdOfVisNodeList".

I wonder if there is any special reason..I'm hung up on it.


I look forward to your reply.
Best,

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.