Formula for Assigning Specified User's Team

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lj4353
    Senior Member
    • Nov 2023
    • 137

    Formula for Assigning Specified User's Team

    Regarding the synchronous setting of assignedUser.teamsNames, I aim to set the work team to be the same as a specified user's team. However, the formula I attempted to use resulted in displaying [object Object], indicating a potential need to convert the object into a string format or to extract specific data from the object.​
    Click image for larger version

Name:	image.png
Views:	199
Size:	49.5 KB
ID:	100748Click image for larger version

Name:	image.png
Views:	149
Size:	26.6 KB
ID:	100749
  • rabii
    Active Community Member
    • Jun 2016
    • 1286

    #2
    teamsNames is a notStorable so you need to use the teamsIds instead, but if you want to see the name you can just loop through them and build your string.
    Rabii
    Here to help :)

    Comment


    • lj4353
      lj4353 commented
      Editing a comment
      How exactly should I proceed?
  • rabii
    Active Community Member
    • Jun 2016
    • 1286

    #3
    try this instead:

    PHP Code:
    $teamsIds assignedUser.teamsIds;

    $i 0;

    while (
    $i array\length($teamsIds)) {
        
        
    $team record\fetch('Team'array\at($teamsIds$i));
        
        if (
    $team) {
            
    job string\concatenate(job' 'object\get($team'name')) ;
        }
        
        
    $i $i 1;
    }
    ​ 
    Rabii
    Here to help :)

    Comment

    Working...