Lookup needed to construct value

Hi @Korchev

I am struggling with something probably basic.
I have a data form (Opp) with drop-downs looking up other tables (Product & Pack). They are joined by their respective ids and that works smoothly.

I am trying to get the ${opp.name} to be constructed out of Product looked-up name + "_" + Pack looked-up name. The trigger for the ${opp.name} construction is the dropdown change event.

Thank you for your help

Fred

I don't understand what this means. Please elaborate. You can check our updated forum FAQ for instructions how to improve your question.

Sure.

I have a data form for sales opportunities, named Opps.

Some of the fields like Products and Packs are lookups to a Product table and a Pack table. In the Opps table, products and packs are referenced by the IDs of the corresponding tables which are loaded as part of the LoadPage of the Opps data form.

.

I would like to generate (or change) the name of the opportunity automatically (currently testName) every time there is a change event in the Product or in the Page dropdown so that the name looks like ProductName_PackName. In the example above, it would be Dior Show_Mascara.

I initially did something like this:


which pulls back the respective Product and Pack IDs and not the name I see in the dropdown.

Hope it is more clear now.

Fred

You will need to find the corresponding item from the getProductsResult and getPacksResult properties and used it instead. Something like this

opp.Name = ${getProductsResult}.Where(product => product.Product == opp.Product).First().ProductName + "_" + ${getPacksResult}.Where(pack => pack.Pack == opp.Pack).First().PackName

You will have to change the property names as they are in your project e.g. Product, ProductName.

1 Like

Great. Thank you very much