cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry Application. How to use result of @COLLECTION_FIND.

Former Member
0 Kudos

Hi All

I need to find value in the collection and show value from other field of the found record.

If no value found then show message "Value is not found".

I build next expressnion

(@COLLECTION_FIND :>12"FlightScheduleCollection" (@EQSTR :>12"ScheduleID" (('60))))

From Instraction


The COLLECTION_FIND function searches a given collection for the first member for which the given second parameter returns true. This second parameter is evaluated once for each member of the collection in a Boolean context. When a member of the search collection is found, that member is returned to the caller of the function.

If no member of the collection results in the search criteria returning true, an empty property of the type within the search collection is returned.

how can I compare that returned value is "empty property"?

How to extract value from other field of found "member"?

Accepted Solutions (0)

Answers (1)

Answers (1)

mark_pe
Active Contributor
0 Kudos

Konstantin,

You may try to use an initial value rule before or after data entry for your other field that needs to show the value.

InitialValueRule_collection_or_ValueNotFound  (On the other field that needs to show the value on the screen)

@IF
|____@EQSTR
              |_______@COLLECTION_FIND
                                         |_____FlightScheduleCollection Property
              |                          |__@EQSTR
                                                     |___ScheduleID Property

              |_""                                 |____60
|

|_____"Value Not Found"
|

|_____@COLLECTION_FIND

                                         |_____FlightScheduleCollection Property
                                         |__@EQSTR
                                                     |___ScheduleID Property

                                                     |____60

Assumption above is that your Collection_FIND found the member based on the scheduleID property of 60.

You may try to play with the above and adjust accordingly.

Best Regards,

SAP Mobile Support Team

jason_latko
Advisor
Advisor
0 Kudos

Konstantin,

See my response in your other thread about how to properly use COLLECTION_FIND to check for existence of a value.

Jason Latko - Senior Product Developer at SAP