Array Formula problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rodrigocoelho
    Active Community Member
    • Jun 2016
    • 296

    Array Formula problems

    Hi folks,

    I'm having problems trying to use a formula on Entity Formula. It is giving error when executing. May you help me with it? Any syntax error?
    The code is below.
    I created a field named initials on the Users entity, and put the Initials of them for each record.
    I created a field named UserInitials on the Task entity, just to have all responsables initials printed.

    Thanks

    Code:
    $source = list(assignedUsersIds);
    $target = list();
    
    $i = 0;
    
    while(
    $i < array\length($source),
    (
    $target = array\push(
    $target,
    record\attribute('User', array\at($source, $i), 'initials')
    );
    $i = $i + 1;
    )
    );
    
    $text = array\join($target, ', ');
    UsersInitials = $text;
  • rodrigocoelho
    Active Community Member
    • Jun 2016
    • 296

    #2
    Fixed it... Here follows the working code for whom is interested...

    Code:
    $source = assignedUsersIds;
    $target = list();
    $i = 0;
    while( $i < array\length($source), ( $target = array\push( $target, record\attribute('User', array\at($source, $i), 'initials') ); $i = $i + 1; )
    );
    $text = array\join($target, ', ');
    sersInitials = $text;

    Comment

    Working...