Skip to Content
avatar image
Former Member

Agentry Application. How to use result of @COLLECTION_FIND.

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"?

sshot-231.png (11.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 01, 2016 at 02:46 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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