VB Apps: Default value as selected item (fetch one) from entity

Hello together,
we are migrating our Legacy Apps to VB. Despite the documentation I am struggling with the function “fetch one” Apps – Benutzerdefinierte VB-Funktionen (uipath.com).

Previously, we had the following formula in “default value”:
=Lookup(entity,[entity.field,“=”,variable]).entity.field

How to set up this formula in VB.Apps?

This is what I have tried. But it does not work:

Fetchone(of entity)(createFilterGroup(New QueryFilter(){addFilter(“entity_fieldname”, “=”, variable)}, Nothing, 0), Nothing, Nothing, Nothing, New ExpansionFieldOption(){addExpansionFieldOption(“CreatedBy”, New String(){“Id”,“Name”}), addExpansionFieldOption(“UpdatedBy”, New String(){“Id”,“Name”})}).entity_field

Thank you!

Hi @PeCour
have send you a PM

The solution to my problem:

  1. Save the fetch data in an AppVariable ListSource of entity.

Fetch(of entity)(createFilterGroup(New QueryFilter(){addFilter(“entity_fieldname”, “=”, variable)}, Nothing, 0), Nothing, Nothing, Nothing, New ExpansionFieldOption(){addExpansionFieldOption(“CreatedBy”, New String(){“Id”,“Name”}), addExpansionFieldOption(“UpdatedBy”, New String(){“Id”,“Name”})}).

  1. Use the App variable to derive the field required.

AppVariable.data.First().Field

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.